← Back to team overview

kicad-developers team mailing list archive

Re: wxString.c_str()


--- In kicad-devel@xxxxxxxxxxxxxxx, Dick Hollenbeck <dick@...> wrote:
> Jean-Pierre & Other Developers,
> It is my understanding that on newer versions of wxWidgets, we will not 
> be able to pass wxString.c_str() to the Printf() function of wxString.  
> And wxString.GetData() will not exist.
> So according to my understanding, we are better writing:
> wxString s;
> wxString formatMe;
> s.Printf( wxT("%s"), GetChars( formatMe ) );
> than this:
> s.Printf( wxT("%s"), formatMe.c_str() );
> For 2.9 or 3.0 the c_str() will not work, at least that is my 
> understanding based on a snapshot 5 months ago when I wrote GetChars().

Just to focus better the situation there is an equivalence in wx2.9 for c_str() and is GetData().
Different will be the situation for the charset as wx3.0 will manage only UNICODE strings.


Follow ups