Changeset 149 for Include/system/string.sbp
- Timestamp:
- Mar 11, 2007, 12:30:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/system/string.sbp
r142 r149 40 40 Dim sizeWCS = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, 0, 0) 41 41 wcs = _System_AllocForConvertedString(SizeOf (WCHAR) * sizeWCS) As PWSTR 42 Get WCStr = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, wcs, sizeWCS)43 wcs[Get WCStr] = 042 GetStr = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, wcs, sizeWCS) 43 wcs[GetStr] = 0 44 44 End Function 45 45 … … 56 56 wcs = psz 57 57 If psz <> 0 Then 58 Return l strlenW(psz)58 Return len 59 59 Else 60 60 Return 0 … … 89 89 Function GetStr(psz As PSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T 90 90 mbs = psz 91 Return len 91 If psz <> 0 Then 92 Return len 93 Else 94 Return 0 95 End If 92 96 End Function 93 97 … … 157 161 158 162 Function GetTCStr(ByRef s As String, ByRef wcs As PCTSTR) As SIZE_T 159 Return GetStr(s.Chars, s.Length , tcs)163 Return GetStr(s.Chars, s.Length As SIZE_T, tcs) 160 164 End Function 161 165 … … 177 181 178 182 Function GetSCStr(ByRef s As String, ByRef wcs As *StrChar) As SIZE_T 179 Return GetStr(s.Chars, s.Length , ss)183 Return GetStr(s.Chars, s.Length As SIZE_T, ss) 180 184 End Function 181 185 182 186 Function ToWCStr(psz As PSTR) As PWSTR 183 ReturnGetStr(psz, ToWCStr)187 GetStr(psz, ToWCStr) 184 188 End Function 185 189 186 190 Function ToWCStr(psz As PSTR, len As SIZE_T) As PWSTR 187 ReturnGetStr(psz, len, ToWCStr)191 GetStr(psz, len, ToWCStr) 188 192 End Function 189 193 190 194 Function ToWCStr(psz As PWSTR) As PWSTR 191 ReturnGetStr(psz, ToWCStr)195 GetStr(psz, ToWCStr) 192 196 End Function 193 197 194 198 Function ToWCStr(psz As PWSTR, len As SIZE_T) As PWSTR 195 ReturnGetStr(psz, len, ToWCStr)199 GetStr(psz, len, ToWCStr) 196 200 End Function 197 201 198 202 Function ToWCStr(ByRef s As String) As PWSTR 199 Return GetStr(s.Chars, s.Length, ToWCStr)203 GetStr(s.Chars As PWSTR, s.Length As SIZE_T, ToWCStr) 200 204 End Function 201 205 202 206 Function ToMBStr(psz As PSTR) As PSTR 203 ReturnGetStr(psz, ToMBStr)207 GetStr(psz, ToMBStr) 204 208 End Function 205 209 206 210 Function ToMBStr(psz As PSTR, len As SIZE_T) As PSTR 207 ReturnGetStr(psz, len, ToMBStr)211 GetStr(psz, len, ToMBStr) 208 212 End Function 209 213 210 214 Function ToMBStr(psz As PWSTR) As PSTR 211 ReturnGetStr(psz, ToMBStr)215 GetStr(psz, ToMBStr) 212 216 End Function 213 217 214 218 Function ToMBStr(psz As PWSTR, len As SIZE_T) As PSTR 215 ReturnGetStr(psz, len, ToMBStr)219 GetStr(psz, len, ToMBStr) 216 220 End Function 217 221 218 222 Function ToMBStr(ByRef s As String) As PSTR 219 Return GetStr(s.Chars, s.Length, ToMBStr)223 GetStr(s.Chars, s.Length As SIZE_T, ToMBStr) 220 224 End Function 221 225 222 226 Function ToTCStr(psz As PSTR) As PCTSTR 223 ReturnGetStr(psz, ToTCStr)227 GetStr(psz, ToTCStr) 224 228 End Function 225 229 226 230 Function ToTCStr(psz As PSTR, len As SIZE_T) As PCTSTR 227 ReturnGetStr(psz, len, ToTCStr)231 GetStr(psz, len, ToTCStr) 228 232 End Function 229 233 230 234 Function ToTCStr(psz As PWSTR) As PCTSTR 231 ReturnGetStr(psz, ToTCStr)235 GetStr(psz, ToTCStr) 232 236 End Function 233 237 234 238 Function ToTCStr(psz As PWSTR, len As SIZE_T) As PCTSTR 235 ReturnGetStr(psz, len, ToTCStr)239 GetStr(psz, len, ToTCStr) 236 240 End Function 237 241 238 242 Function ToTCStr(ByRef s As String) As PCTSTR 239 Return GetStr(s.Chars, s.Length, ToTCStr)243 GetStr(s.Chars, s.Length As SIZE_T, ToTCStr) 240 244 End Function 241 245 242 246 Function ToSCStr(psz As PSTR) As *StrChar 243 ReturnGetStr(psz, ToSCStr)247 GetStr(psz, ToSCStr) 244 248 End Function 245 249 246 250 Function ToSCStr(psz As PSTR, len As SIZE_T) As *StrChar 247 ReturnGetStr(psz, len, ToSCStr)251 GetStr(psz, len, ToSCStr) 248 252 End Function 249 253 250 254 Function ToSCStr(psz As PWSTR) As *StrChar 251 ReturnGetStr(psz, ToSCStr)255 GetStr(psz, ToSCStr) 252 256 End Function 253 257 254 258 Function ToSCStr(psz As PWSTR, len As SIZE_T) As *StrChar 255 ReturnGetStr(psz, len, ToSCStr)259 GetStr(psz, len, ToSCStr) 256 260 End Function 257 261 258 262 Function ToSCStr(ByRef s As String) As *StrChar 259 Return GetStr(s.Chars, s.Length, ToSCStr)263 GetStr(s.Chars, s.Length As SIZE_T, ToSCStr) 260 264 End Function 261 265
Note:
See TracChangeset
for help on using the changeset viewer.