Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| Lars Gullik Bjønnes wrote:
| > Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| > | Am I right that all of the filetools.h API should be converted to
| > docstring?
| > | | I have started the conversion already so please tell me quick if
| > | that's not the case.
| > Filesystems and unicode is tricky.
| > And I am not sure if a "blind" conversion is the way to go.
| > But, yes, I think we should allow for utf-8 filesystem (I do not
| > think
| > anyone uses utf-16 in the filesystem?)
|
| I think NTFS is UFT16...
Hmm... strange choice imho.
| > I'd prefere is most of this work tried to leverage boost::filesystem
| > as much as possible.
|
| Yes, I think I've read somewhere that boost::filesystem will support
| the default encoding of the system in 1.34.
Note that we are using 1.34 now.
Yes and the support seems to be here indeed. See this for example
extracted from the boost source code:
inline bool is_directory( const path & ph )
{ return is_directory<path>( ph ); }
inline bool is_directory( const wpath & ph )
{ return is_directory<wpath>( ph ); }
The problem is that wpath is using wstring:
typedef basic_path< std::wstring, wpath_traits > wpath;
So I don't know how to make use of that for now. I guess using wstring
is out of the question because we already have docstring. But then we
need lyx::char_type specially tailored path_trait. I don't know how
difficult this can be but we could probably use some idea on how they've
done it:
struct wpath_traits
{
typedef std::wstring internal_string_type;
# ifdef BOOST_WINDOWS_API
typedef std::wstring external_string_type;
static external_string_type to_external( const wpath &,
const internal_string_type & src ) { return src; }
static internal_string_type to_internal(
const external_string_type & src ) { return src; }
# else
typedef std::string external_string_type;
static external_string_type to_external( const wpath & ph,
const internal_string_type & src );
static internal_string_type to_internal(
const external_string_type & src );
# endif
static void imbue( const std::locale & loc );
static bool imbue( const std::locale & loc, const std::nothrow_t & );
};
I am getting a headache ;-/
Abdel.