libplatform/platform_win32_impl.h Source File
platform_win32_impl.h
1// Note that we have a separate platform_win32_impl.h to deal with the fact that windows.h defines a macro
2// called FindAtom, which mp4v2 also defines. In older versions of visual studio, this actually causes
3// some pretty seriously issues with naming collisions and the defined macros (think infamous min/max macro
4// of windows.h vs stdc++'s min/max template functions)
5#include <windows.h>
6
8
9namespace mp4v2 { namespace platform { namespace win32 {
10
12{
13 public:
14 Utf8ToFilename( const string &utf8string );
16
17 bool IsUTF16Valid( ) const;
18
19 operator LPCWSTR( ) const { return _wideCharString; }
20 operator LPWSTR( ) const { return _wideCharString; }
21
22 private:
23 Utf8ToFilename ( const Utf8ToFilename &src );
24 Utf8ToFilename &operator= ( const Utf8ToFilename &src );
25
26 wchar_t *ConvertToUTF16 ( const string &utf8 );
27
28 static int ConvertToUTF16Buf ( const char *utf8,
29 wchar_t *utf16_buf,
30 size_t num_bytes );
31 static int GetPrefixLen ( const string &utf8string );
32
33 static int IsAbsolute ( const string &utf8string );
34
35 static int IsPathSeparator ( char c );
36
37 static int IsUncPath ( const string &utf8string );
38
39 static const UINT8 *Utf8DecodeChar (
40 const UINT8 *utf8_char,
41 size_t num_bytes,
42 wchar_t *utf16,
43 int *invalid
44 );
45
46 static size_t Utf8LenFromUcs4 ( UINT32 ucs4 );
47
48 static UINT8 Utf8NumOctets ( UINT8 utf8_first_byte );
49
53 string _utf8;
54
58 wchar_t* _wideCharString;
59
60 public:
61
65 const string& utf8;
66};
67
68}}} // namespace mp4v2::platform::win32
Definition platform_win32_impl.h:12
const string & utf8
Accessor for _utf8.
Definition platform_win32_impl.h:65