[wx-dev] Re: SVN:(SC) [51735] adding filename conversion for wxStat

Stefan Csomor csomor at advancedconcepts.ch
Wed Feb 13 13:19:02 PST 2008


Hi

On 2/13/08 9:48 PM, "Vadim Zeitlin" <vadim at wxwidgets.org> wrote:

> On Wed, 13 Feb 2008 15:34:57 -0500 David Elliott <dfe at tgwbd.org> wrote:
> 
> DE> I changed this to just use stat instead of wxStat since calling
> DE> fn_str() then feeding it through wxConvFile seems ridiculous.  That
> DE> makes it compile for me. I have no idea if we wanted to add wxStat
> DE> explicitly taking a wxString (instead of wxChar*) which can do
> DE> fn_str() itself or add one explicitly taking a char* (that it can pass
> DE> through directly to the underlying stat) or what really the best
> DE> course of action is here.
> 
>  We're talking about 2.8 here, right? Because in the trunk wxStat() already
> takes a wxString (as it must to allow passing both ANSI and Unicode strings
> to it which is a requirement of wx3 API).
> 
>  As for 2.8 it takes just "const wxChar *" there, being a simple #define
> and hence fn_str() should be used by the caller before passing the string
> to it. What exactly is the problem with it, i.e. why is it ridiculous?

the problem in unicode is that wxNEED_WX_UNISTD_H gets defined resulting in
the other implementation, using stat and fn_str() works in both builds,
using wxStat would be wrong in the unicode situation as it would convert yet
again using wxConvFile (in the code in filefn.cpp 133)

Best,

Stefan







More information about the wx-dev mailing list