16.01.2013 17:00, Max Kellermann пишет:
> What kind of path name would this class represent - MPD's internal
> path names (always narrow), or the external OS path names (sometimes
> wide)?

This would contain OS path names.

> Finding a good representation for strings is perhaps one of the most
> difficult things in C++, at least when you want to avoid overhead (and
> C++ is extremely good at giving you ways to avoid overhead, something
> which is not possible in higher-level languages):
>
> 1) a pointer to a C string (const char *)
>
> 2) an dynamically allocated buffer (e.g. std::string)
>
> 3) a fixed-size buffer (e.g. char[PATH_MAX])

I'd start with std::string/std::wstring.

I think those are very optimized* and borrowing a custom solution 
wouldn't beat std::string performance unless it has some significantly 
reduced functionality.

* especially since we're using C++11: it has some good features such 
rvalue-references that allow simple move semantics.

>
> The GLib functions are not terribly sophisticated, they are merely a
> convenience.  Having a class that has well-defined methods for path
> manipulation would be even more convenient.
>

Yes, this is what I'm talking about.

-- 
Denis

------------------------------------------------------------------------------
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