MP4v2

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
9 namespace mp4v2 { namespace platform { namespace win32 {
10
11 class Utf8ToFilename
12{
13 public:
14 Utf8ToFilename( const string &utf8string );
15 ~Utf8ToFilename( );
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
32 static bool HasPrefix ( const string &utf8string );
33 static string StripPrefix ( const string &utf8string );
34
35 static int IsAbsolute ( const string &utf8string );
36
37 static int IsPathSeparator ( char c );
38
39 static int IsUncPath ( const string &utf8string );
40
41 static const uint8_t *Utf8DecodeChar (
42 const uint8_t *utf8_char,
43 size_t num_bytes,
44 wchar_t *utf16,
45 int *invalid
46 );
47
48 static size_t Utf8LenFromUcs4 ( uint32_t ucs4 );
49
50 static uint8_t Utf8NumOctets ( uint8_t utf8_first_byte );
51
55 string _utf8;
56
60 wchar_t* _wideCharString;
61
62 public:
63
67 const string& utf8;
68};
69
70}}} // namespace mp4v2::platform::win32
mp4v2::platform::win32::Utf8ToFilename
Definition: platform_win32_impl.h:12
mp4v2::platform::win32::Utf8ToFilename::utf8
const string & utf8
Accessor for _utf8.
Definition: platform_win32_impl.h:67