On 2013/01/16 13:42, Denis Krjuchkov <de...@crazydev.net> wrote:
> 16.01.2013 18:25, Max Kellermann ??????????:
> >It doubles the overhead.
> 
> Could you provide an example?
> I can't really imagine how this doubles overhead.

First you map UTF-8 to filesystem path (e.g. via map_uri_fs()), which
duplicates the string.  Then for conversion to your path class (for
passing to a system call), std::string duplicates the string again.
Makes two allocations instead of one, even on sane operating systems.

> Storage class for what?
> For protocol FileName (which is always UTF-8 anyway)?

The protocol doesn't have path names.  There are these "file://" URIs
but they are not "real" path names, even though they technically
represent ones.  Therefore, protocol strings shall be char* or
something based on it.  char* shall always be UTF-8.

> Or for real file names which you want to keep as char*?
> If second this would introduce pre-processor weirdness in the code
> that uses stdio and friends because each such call would require
> #ifdef.

In any case, you need some glue that selects narrow or wide system
calls.  You can't avoid that, can you?

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to