- Timestamp:
- Mar 29, 2009, 2:45:04 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/system/string.sbp
r671 r697 23 23 End Function 24 24 25 26 25 Function MakeStr(psz As PSTR) As String 27 26 Return New String(psz) … … 38 37 Function GetWCStr(mbsSrc As PSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T 39 38 Dim lenWCS = MultiByteToWideChar(CP_ACP, 0, mbsSrc, (len As DWord) As Long, 0, 0) 40 wcsDst = _System_AllocForConvertedString(SizeOf (WCHAR) * lenWCS) As PWSTR39 wcsDst = _System_AllocForConvertedString(SizeOf (WCHAR) * (lenWCS + 1)) As PWSTR 41 40 GetWCStr = MultiByteToWideChar(CP_ACP, 0, mbsSrc, (len As DWord) As Long, wcsDst, lenWCS) 41 wcsDst[lenWCS] = 0 42 42 End Function 43 43 … … 49 49 Function GetMBStr(wcsSrc As PWSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T 50 50 Dim lenMBS = WideCharToMultiByte(CP_ACP, 0, wcsSrc, (len As DWord) As Long, 0, 0, 0, 0) 51 mbsDst = _System_AllocForConvertedString(SizeOf (CHAR) * lenMBS) As PSTR51 mbsDst = _System_AllocForConvertedString(SizeOf (CHAR) * (lenMBS + 1)) As PSTR 52 52 GetMBStr = WideCharToMultiByte(CP_ACP, 0, wcsSrc, (len As DWord) As Long, mbsDst, lenMBS, 0, 0) As SIZE_T 53 mbsDst[lenMBS] = 0 53 54 End Function 54 55 … … 80 81 変換の組み合わせは、 81 82 入力引数: wcsz, wcs + len, mbsz, mbs + len, str 82 出力関数: wcs(z)出力GetStr, mbs(z)出力GetStr, 83 GetWCStr, GetMBStr, GetTCStr, 84 ToWCStr, ToMBStr, ToTCStr, 85 で、5 * 8 = 40通り。 83 出力関数: wcs(z)出力GetStr, mbs(z)出力GetStr, ToWCStr, ToMBStr, ToTCStr, 84 で、5 * 5 = 25通り。 86 85 */ 87 86 … … 91 90 Return 0 92 91 Else 93 Return Detail.GetWCStr(mbszSrc, (lstrlenA(mbszSrc) + 1) As SIZE_T, wcsDst)92 Return Detail.GetWCStr(mbszSrc, lstrlenA(mbszSrc) As SIZE_T, wcsDst) 94 93 End If 95 94 End Function … … 129 128 Return 0 130 129 Else 131 Return Detail.GetMBStr(wcszSrc, (lstrlenW(wcszSrc) + 1) As SIZE_T, mbsDst)130 Return Detail.GetMBStr(wcszSrc, lstrlenW(wcszSrc) As SIZE_T, mbsDst) 132 131 End If 133 132 End Function … … 178 177 Return Detail.GetMBStr(strSrc.StrPtr, strSrc.Length As SIZE_T, mbsDst) 179 178 End If 180 End Function181 182 Function GetWCStr(mbszSrc As PSTR, ByRef wcsDst As PWSTR) As SIZE_T183 Return GetStr(mbszSrc, wcsDst)184 End Function185 186 Function GetWCStr(mbsSrc As PSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T187 Return GetStr(mbsSrc, len, wcsDst)188 End Function189 190 Function GetWCStr(wcszSrc As PWSTR, ByRef wcsDst As PWSTR) As SIZE_T191 Return GetStr(wcszSrc, wcsDst)192 End Function193 194 Function GetWCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T195 Return GetStr(wcsSrc, len, wcsDst)196 End Function197 198 Function GetWCStr(strSrc As String, ByRef wcsDst As PWSTR) As SIZE_T199 Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, wcsDst)200 End Function201 202 Function GetMBStr(mbszSrc As PWSTR, ByRef mbsDst As PSTR) As SIZE_T203 Return GetStr(mbszSrc, mbsDst)204 End Function205 206 Function GetMBStr(wcsSrc As PWSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T207 Return GetStr(wcsSrc, len, mbsDst)208 End Function209 210 Function GetMBStr(mbszSrc As PSTR, ByRef mbsDst As PSTR) As SIZE_T211 Return GetStr(mbszSrc, mbsDst)212 End Function213 214 Function GetMBStr(mbsSrc As PSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T215 Return GetStr(mbsSrc, len, mbsDst)216 End Function217 218 Function GetMBStr(strSrc As String, ByRef mbsDst As PSTR) As SIZE_T219 Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, mbsDst)220 End Function221 222 Function GetTCStr(mbszSrc As PSTR, ByRef tcsDst As PCTSTR) As SIZE_T223 Return GetStr(mbszSrc, tcsDst)224 End Function225 226 Function GetTCStr(mbsSrc As PSTR, len As SIZE_T, ByRef tcsDst As PCTSTR) As SIZE_T227 Return GetStr(mbsSrc, len, tcsDst)228 End Function229 230 Function GetTCStr(wcszSrc As PWSTR, ByRef tcsDst As PCTSTR) As SIZE_T231 Return GetStr(wcszSrc, tcsDst)232 End Function233 234 Function GetTCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef tcsDst As PCTSTR) As SIZE_T235 Return GetStr(wcsSrc, len, tcsDst)236 End Function237 238 Function GetTCStr(strSrc As String, ByRef tcsDst As PCTSTR) As SIZE_T239 Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, tcsDst)240 179 End Function 241 180
Note:
See TracChangeset
for help on using the changeset viewer.