2 // Copyright (C) 2011 Suguru Kawamoto
\r
3 // マルチバイト文字ワイド文字APIラッパー
\r
5 #ifndef __MBSWRAPPER_H__
\r
6 #define __MBSWRAPPER_H__
\r
12 #ifndef DO_NOT_REPLACE
\r
15 #define CreateFile CreateFileM
\r
16 HANDLE CreateFileM(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
\r
17 #undef FindFirstFile
\r
18 #define FindFirstFile FindFirstFileM
\r
19 HANDLE FindFirstFileM(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData);
\r
21 #define FindNextFile FindNextFileM
\r
22 BOOL FindNextFileM(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData);
\r
23 #undef GetCurrentDirectory
\r
24 #define GetCurrentDirectory GetCurrentDirectoryM
\r
25 DWORD GetCurrentDirectoryM(DWORD nBufferLength, LPSTR lpBuffer);
\r
26 #undef SetCurrentDirectory
\r
27 #define SetCurrentDirectory SetCurrentDirectoryM
\r
28 BOOL SetCurrentDirectoryM(LPCSTR lpPathName);
\r
30 #define GetTempPath GetTempPathM
\r
31 DWORD GetTempPathM(DWORD nBufferLength, LPSTR lpBuffer);
\r
32 #undef GetFileAttributes
\r
33 #define GetFileAttributes GetFileAttributesM
\r
34 DWORD GetFileAttributesM(LPCSTR lpFileName);
\r
35 #undef GetModuleFileName
\r
36 #define GetModuleFileName GetModuleFileNameM
\r
37 DWORD GetModuleFileNameM(HMODULE hModule, LPCH lpFilename, DWORD nSize);
\r
39 #define CopyFile CopyFileM
\r
40 BOOL CopyFileM(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists);
\r
42 #define mkdir _mkdirM
\r
43 int mkdirM(const char * _Path);
\r
45 #define _mkdir _mkdirM
\r
46 int _mkdirM(const char * _Path);
\r
48 #define rmdir rmdirM
\r
49 int rmdirM(const char * _Path);
\r
51 #define _rmdir _rmdirM
\r
52 int _rmdirM(const char * _Path);
\r
54 #define remove removeM
\r
55 int removeM(const char * _Filename);
\r
57 #define _remove _removeM
\r
58 int _removeM(const char * _Filename);
\r
60 #define _unlink _unlinkM
\r
61 int _unlinkM(const char * _Filename);
\r
63 #define _mbslen _mbslenM
\r
64 size_t _mbslenM(const unsigned char * _Str);
\r
66 #define _mbschr _mbschrM
\r
67 unsigned char * _mbschrM(const unsigned char * _Str, unsigned int _Ch);
\r
69 #define _mbsrchr _mbsrchrM
\r
70 unsigned char * _mbsrchrM(const unsigned char * _Str, unsigned int _Ch);
\r
72 #define _mbsstr _mbsstrM
\r
73 unsigned char * _mbsstrM(const unsigned char * _Str, const unsigned char * _Substr);
\r
75 #define _mbscmp _mbscmpM
\r
76 int _mbscmpM(const unsigned char * _Str1, const unsigned char * _Str2);
\r
78 #define _mbsicmp _mbsicmpM
\r
79 int _mbsicmpM(const unsigned char * _Str1, const unsigned char * _Str2);
\r
81 #define _mbsncmp _mbsncmpM
\r
82 int _mbsncmpM(const unsigned char * _Str1, const unsigned char * _Str2, size_t _MaxCount);
\r
84 #define _mbslwr _mbslwrM
\r
85 unsigned char * _mbslwrM(unsigned char * _String);
\r
87 #define _mbsupr _mbsuprM
\r
88 unsigned char * _mbsuprM(unsigned char * _String);
\r
90 #define _mbsninc _mbsnincM
\r
91 unsigned char * _mbsnincM(const unsigned char * _Str, size_t _Count);
\r
93 #define fopen fopenM
\r
94 FILE * fopenM(const char * _Filename, const char * _Mode);
\r
98 int MtoW(LPWSTR pDst, int size, LPCSTR pSrc, int count);
\r
99 int WtoM(LPSTR pDst, int size, LPCWSTR pSrc, int count);
\r
100 int AtoW(LPWSTR pDst, int size, LPCSTR pSrc, int count);
\r
101 int WtoA(LPSTR pDst, int size, LPCWSTR pSrc, int count);
\r
102 int TerminateStringM(LPSTR lpString, int size);
\r
103 int TerminateStringW(LPWSTR lpString, int size);
\r
104 int TerminateStringA(LPSTR lpString, int size);
\r
105 size_t GetMultiStringLengthM(LPCSTR lpString);
\r
106 size_t GetMultiStringLengthW(LPCWSTR lpString);
\r
107 size_t GetMultiStringLengthA(LPCSTR lpString);
\r
108 int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc);
\r
109 int WtoMMultiString(LPSTR pDst, int size, LPCWSTR pSrc);
\r
110 int AtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc);
\r
111 int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc);
\r
112 char* AllocateStringM(int size);
\r
113 wchar_t* AllocateStringW(int size);
\r
114 char* AllocateStringA(int size);
\r
115 wchar_t* DuplicateMtoW(LPCSTR lpString, int c);
\r
116 wchar_t* DuplicateMtoWBuffer(LPCSTR lpString, int c, int size);
\r
117 wchar_t* DuplicateMtoWMultiString(LPCSTR lpString);
\r
118 wchar_t* DuplicateMtoWMultiStringBuffer(LPCSTR lpString, int size);
\r
119 char* DuplicateWtoM(LPCWSTR lpString, int c);
\r
120 wchar_t* DuplicateAtoW(LPCSTR lpString, int c);
\r
121 char* DuplicateWtoA(LPCWSTR lpString, int c);
\r
122 DWORD GetNextCharM(LPCSTR lpString, LPCSTR* ppNext);
\r
123 BOOL FixStringM(LPSTR pDst, LPCSTR pSrc);
\r
124 BOOL FixMultiStringM(LPSTR pDst, LPCSTR pSrc);
\r
125 BOOL CheckStringM(LPCSTR lpString);
\r
126 BOOL CheckMultiStringM(LPCSTR lpString);
\r
127 void FreeDuplicatedString(void* p);
\r