Changeset 395 for trunk/Include


Ignore:
Timestamp:
Dec 10, 2007, 11:59:48 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

ToXXStrの効率化のため、GetStrの戻り値なし版、GetStrNTの追加。
Stringを引数に取る変換関数で、Nothingが渡された場合の対応を追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/system/string.sbp

    r386 r395  
    3131_System_AllocForConvertedString = AddressOf (GC_malloc_atomic)
    3232
    33 Function GetStr(psz As PSTR, ByRef wcs As PWSTR) As SIZE_T
    34     If psz <> 0 Then
    35         Return GetStr(psz, lstrlenA(psz) As SIZE_T, wcs)
    36     Else
    37         Return 0
    38     End If
    39 End Function
    40 
    41 Function GetStr(psz As PSTR, len As SIZE_T, ByRef wcs As PWSTR) As SIZE_T
    42     If psz = 0 Then Return 0
    43     Dim lenWCS = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, (len As DWord) As Long, 0, 0)
    44     wcs = _System_AllocForConvertedString(SizeOf (WCHAR) * (lenWCS + 1)) As PWSTR
    45     GetStr = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, (len As DWord) As Long, wcs, lenWCS)
    46     wcs[GetStr] = 0
    47 End Function
    48 
    49 Function GetStr(psz As PWSTR, ByRef wcs As PWSTR) As SIZE_T
    50     wcs = psz
    51     If psz <> 0 Then
    52         Return lstrlenW(psz) As SIZE_T
    53     Else
    54         Return 0
    55     End If
    56 End Function
    57 
    58 Function GetStr(psz As PWSTR, len As SIZE_T, ByRef wcs As PWSTR) As SIZE_T
    59     wcs = psz
    60     If psz <> 0 Then
     33Namespace Detail
     34    Function GetWCStr(mbsSrc As PSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
     35        Dim lenWCS = MultiByteToWideChar(CP_THREAD_ACP, 0, mbsSrc, (len As DWord) As Long, 0, 0)
     36        wcsDst = _System_AllocForConvertedString(SizeOf (WCHAR) * (lenWCS + 1)) As PWSTR
     37        GetWCStr = MultiByteToWideChar(CP_THREAD_ACP, 0, mbsSrc, (len As DWord) As Long, wcsDst, lenWCS)
     38        wcsDst[GetWCStr] = 0
     39    End Function
     40
     41    Function GetWCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
     42        wcsDst = wcsSrc
     43        GetWCStr = len
     44    End Function
     45
     46    Function GetMBStr(wcsSrc As PWSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
     47        Dim lenMBS = WideCharToMultiByte(CP_THREAD_ACP, 0, wcsSrc, (len As DWord) As Long, 0, 0, 0, 0)
     48        mbsDst = _System_AllocForConvertedString(SizeOf (SByte) * (lenMBS + 1)) As PSTR
     49        GetMBStr = WideCharToMultiByte(CP_THREAD_ACP, 0, wcsSrc, (wcsSrc As DWord) As Long, mbsDst, lenMBS, 0, 0) As SIZE_T
     50        mbsDst[GetMBStr] = 0
     51    End Function
     52
     53    Function GetMBStr(mbsSrc As PSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
     54        mbsDst = mbsSrc
     55        GetMBStr = len
     56    End Function
     57End Namespace
     58
     59/*
     60変換の組み合わせは、
     61入力引数: wcsz, wcs + len, mbsz, mbs + len, str
     62出力関数: wcs(z)出力GetStr, mbs(z)出力GetStr,
     63          wcs(z)出力GetStrNT, mbs(z)出力GetStrNT,
     64          GetWCStr, GetMBStr, GetTCStr, GetSCStr,
     65          ToWCStr, ToMBStr, ToTCStr, ToSCStr
     66で、5 * 12 = 60通り。
     67*/
     68
     69Function GetStr(mbszSrc As PSTR, ByRef wcsDst As PWSTR) As SIZE_T
     70    If mbszSrc = 0 Then
     71        wcsDst = 0
     72        Return 0
     73    Else
     74        Return Detail.GetWCStr(mbszSrc, lstrlenA(mbszSrc) As SIZE_T, wcsDst)
     75    End If
     76End Function
     77
     78Function GetStr(mbsSrc As PSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
     79    If mbsSrc = 0 Then
     80        wcsDst = 0
     81        Return 0
     82    Else
     83        Return Detail.GetWCStr(mbsSrc, len, wcsDst)
     84    End If
     85End Function
     86
     87Function GetStr(wcszSrc As PWSTR, ByRef wcsDst As PWSTR) As SIZE_T
     88    If wcszSrc = 0 Then
     89        wcsDst = 0
     90        Return 0
     91    Else
     92        wcsDst = wcszSrc
     93        Return lstrlenW(wcszSrc) As SIZE_T
     94    End If
     95End Function
     96
     97Function GetStr(wcsSrc As PWSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
     98    If wcsSrc = 0 Then
     99        wcsDst = 0
     100        Return 0
     101    Else
     102        wcsDst = wcsSrc
    61103        Return len
    62     Else
    63         Return 0
    64     End If
    65 End Function
    66 
    67 Function GetStr(psz As PWSTR, ByRef mbs As PSTR) As SIZE_T
    68     If psz = 0 Then
    69         Return 0
    70     Else
    71         Return GetStr(psz, lstrlenW(psz) As SIZE_T, mbs)
    72     End If
    73 End Function
    74 
    75 Function GetStr(psz As PWSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T
    76     If psz = 0 Then Return 0
    77     Dim lenMBS = WideCharToMultiByte(CP_THREAD_ACP, 0, psz, (len As DWord) As Long, 0, 0, 0, 0)
    78     mbs = _System_AllocForConvertedString(SizeOf (SByte) * (lenMBS + 1)) As PSTR
    79     GetStr = WideCharToMultiByte(CP_THREAD_ACP, 0, psz, (len As DWord) As Long, mbs, lenMBS, 0, 0) As SIZE_T
    80     mbs[GetStr] = 0
    81 End Function
    82 
    83 Function GetStr(psz As PSTR, ByRef mbs As PSTR) As SIZE_T
    84     mbs = psz
    85     If psz <> 0 Then
    86         Return lstrlenA(psz) As SIZE_T
    87     Else
    88         Return 0
    89     End If
    90 End Function
    91 
    92 Function GetStr(psz As PSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T
    93     mbs = psz
    94     If psz <> 0 Then
     104    End If
     105End Function
     106
     107Function GetStr(wcszSrc As PWSTR, ByRef mbsDst As PSTR) As SIZE_T
     108    If wcszSrc = 0 Then
     109        mbsDst = 0
     110        Return 0
     111    Else
     112        Return Detail.GetMBStr(wcszSrc, lstrlenW(wcszSrc) As SIZE_T, mbsDst)
     113    End If
     114End Function
     115
     116Function GetStr(wcsSrc As PWSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
     117    If wcsSrc = 0 Then
     118        mbsDst = 0
     119        Return 0
     120    Else
     121        Return Detail.GetMBStr(wcsSrc, len As SIZE_T, mbsDst)
     122    End If
     123End Function
     124
     125Function GetStr(mbszSrc As PSTR, ByRef mbsDst As PSTR) As SIZE_T
     126    If mbszSrc = 0 Then
     127        mbsDst = 0
     128        Return 0
     129    Else
     130        mbsDst = mbszSrc
     131        Return lstrlenA(mbszSrc) As SIZE_T
     132    End If
     133End Function
     134
     135Function GetStr(mbsSrc As PSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
     136    If mbsSrc = 0 Then
     137        mbsDst = 0
    95138        Return len
    96139    Else
    97         Return 0
    98     End If
    99 End Function
    100 
    101 Function GetStr(s As String, ByRef mbs As PSTR) As SIZE_T
    102     Return GetStr(s.StrPtr, s.Length As SIZE_T, mbs)
    103 End Function
    104 
    105 Function GetStr(s As String, ByRef wcs As PWSTR) As SIZE_T
    106     Return GetStr(s.StrPtr, s.Length As SIZE_T, wcs)
    107 End Function
    108 
    109 Function GetWCStr(psz As PSTR, ByRef wcs As PWSTR) As SIZE_T
    110     Return GetStr(psz, wcs)
    111 End Function
    112 
    113 Function GetWCStr(psz As PSTR, len As SIZE_T, ByRef wcs As PWSTR) As SIZE_T
    114     Return GetStr(psz, len, wcs)
    115 End Function
    116 
    117 Function GetWCStr(psz As PWSTR, ByRef wcs As PWSTR) As SIZE_T
    118     Return GetStr(psz, wcs)
    119 End Function
    120 
    121 Function GetWCStr(psz As PWSTR, len As SIZE_T, ByRef wcs As PWSTR) As SIZE_T
    122     Return GetStr(psz, len, wcs)
    123 End Function
    124 
    125 Function GetWCStr(s As String, ByRef wcs As PWSTR) As SIZE_T
    126     Return GetStr(s.StrPtr, s.Length As SIZE_T, wcs)
    127 End Function
    128 
    129 Function GetMBStr(psz As PWSTR, ByRef mbs As PSTR) As SIZE_T
    130     Return GetStr(psz, mbs)
    131 End Function
    132 
    133 Function GetMBStr(psz As PWSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T
    134     Return GetStr(psz, len, mbs)
    135 End Function
    136 
    137 Function GetMBStr(psz As PSTR, ByRef mbs As PSTR) As SIZE_T
    138     Return GetStr(psz, mbs)
    139 End Function
    140 
    141 Function GetMBStr(psz As PSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T
    142     Return GetStr(psz, len, mbs)
    143 End Function
    144 
    145 Function GetMBStr(s As String, ByRef mbs As PSTR) As SIZE_T
    146     Return GetStr(s.StrPtr, s.Length As SIZE_T, mbs)
    147 End Function
    148 
    149 Function GetTCStr(psz As PSTR, ByRef tcs As PCTSTR) As SIZE_T
    150     Return GetStr(psz, tcs)
    151 End Function
    152 
    153 Function GetTCStr(psz As PSTR, len As SIZE_T, ByRef tcs As PCTSTR) As SIZE_T
    154     Return GetStr(psz, len, tcs)
    155 End Function
    156 
    157 Function GetTCStr(psz As PWSTR, ByRef tcs As PCTSTR) As SIZE_T
    158     Return GetStr(psz, tcs)
    159 End Function
    160 
    161 Function GetTCStr(psz As PWSTR, len As SIZE_T, ByRef tcs As PCTSTR) As SIZE_T
    162     Return GetStr(psz, len, tcs)
    163 End Function
    164 
    165 Function GetTCStr(s As String, ByRef tcs As PCTSTR) As SIZE_T
    166     Return GetStr(s.StrPtr, s.Length As SIZE_T, tcs)
    167 End Function
    168 
    169 Function GetSCStr(psz As PSTR, ByRef ss As *StrChar) As SIZE_T
    170     Return GetStr(psz, ss)
    171 End Function
    172 
    173 Function GetSCStr(psz As PSTR, len As SIZE_T, ByRef ss As *StrChar) As SIZE_T
    174     Return GetStr(psz, len, ss)
    175 End Function
    176 
    177 Function GetSCStr(psz As PWSTR, ByRef ss As *StrChar) As SIZE_T
    178     Return GetStr(psz, ss)
    179 End Function
    180 
    181 Function GetSCStr(psz As PWSTR, len As SIZE_T, ByRef ss As *StrChar) As SIZE_T
    182     Return GetStr(psz, len, ss)
    183 End Function
    184 
    185 Function GetSCStr(s As String, ByRef ss As *StrChar) As SIZE_T
    186     Return GetStr(s.StrPtr, s.Length As SIZE_T, ss)
    187 End Function
    188 
    189 Function ToWCStr(psz As PSTR) As PWSTR
    190     GetStr(psz, ToWCStr)
    191 End Function
    192 
    193 Function ToWCStr(psz As PSTR, len As SIZE_T) As PWSTR
    194     GetStr(psz, len, ToWCStr)
    195 End Function
    196 
    197 Function ToWCStr(psz As PWSTR) As PWSTR
    198     GetStr(psz, ToWCStr)
    199 End Function
    200 
    201 Function ToWCStr(psz As PWSTR, len As SIZE_T) As PWSTR
    202     GetStr(psz, len, ToWCStr)
     140        mbsDst = mbsSrc
     141        Return 0
     142    End If
     143End Function
     144
     145Function GetStr(strSrc As String, ByRef wcsDst As PWSTR) As SIZE_T
     146    If ActiveBasic.IsNothing(strSrc) Then
     147        wcsDst = 0
     148        Return 0
     149    Else
     150        Return Detail.GetWCStr(strSrc.StrPtr, strSrc.Length As SIZE_T, wcsDst)
     151    End If
     152End Function
     153
     154Function GetStr(strSrc As String, ByRef mbsDst As PSTR) As SIZE_T
     155    If ActiveBasic.IsNothing(strSrc) Then
     156        mbsDst = 0
     157        Return 0
     158    Else
     159        Return Detail.GetMBStr(strSrc.StrPtr, strSrc.Length As SIZE_T, mbsDst)
     160    End If
     161End Function
     162
     163Sub GetStrNT(mbszSrc As PSTR, ByRef mbszDst As PSTR)
     164    mbszDst = mbszSrc
     165End Sub
     166
     167Sub GetStrNT(mbsSrc As PSTR, len As SIZE_T, ByRef mbszDst As PSTR)
     168    mbszDst = mbsSrc
     169End Sub
     170
     171Sub GetStrNT(mbszSrc As PSTR, ByRef wcszDst As PWSTR)
     172    GetStr(mbszSrc, wcszDst)
     173End Sub
     174
     175Sub GetStrNT(mbsSrc As PSTR, len As SIZE_T, ByRef wcszDst As PWSTR)
     176    GetStr(mbsSrc, len, wcszDst)
     177End Sub
     178
     179Sub GetStrNT(wcszSrc As PWSTR, ByRef mbszDst As PSTR)
     180    GetStr(wcszSrc, mbszDst)
     181End Sub
     182
     183Sub GetStrNT(wcsSrc As PWSTR, len As SIZE_T, ByRef mbszDst As PSTR)
     184    GetStr(wcsSrc, len, mbszDst)
     185End Sub
     186
     187Sub GetStrNT(wcszSrc As PWSTR, ByRef wcszDst As PWSTR)
     188    wcszDst = wcszSrc
     189End Sub
     190
     191Sub GetStrNT(wcsSrc As PWSTR, len As SIZE_T, ByRef wcszDst As PWSTR)
     192    wcszDst = wcsSrc
     193End Sub
     194
     195Sub GetStrNT(strSrc As String, ByRef mbszDst As PSTR)
     196    GetStr(strSrc, mbszDst)
     197End Sub
     198
     199Sub GetStrNT(strSrc As String, ByRef wcszDst As PWSTR)
     200    GetStr(strSrc, wcszDst)
     201End Sub
     202
     203Function GetWCStr(mbszSrc As PSTR, ByRef wcsDst As PWSTR) As SIZE_T
     204    Return GetStr(mbszSrc, wcsDst)
     205End Function
     206
     207Function GetWCStr(mbsSrc As PSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
     208    Return GetStr(mbsSrc, len, wcsDst)
     209End Function
     210
     211Function GetWCStr(wcszSrc As PWSTR, ByRef wcsDst As PWSTR) As SIZE_T
     212    Return GetStr(wcszSrc, wcsDst)
     213End Function
     214
     215Function GetWCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
     216    Return GetStr(wcsSrc, len, wcsDst)
     217End Function
     218
     219Function GetWCStr(strSrc As String, ByRef wcsDst As PWSTR) As SIZE_T
     220    Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, wcsDst)
     221End Function
     222
     223Function GetMBStr(mbszSrc As PWSTR, ByRef mbsDst As PSTR) As SIZE_T
     224    Return GetStr(mbszSrc, mbsDst)
     225End Function
     226
     227Function GetMBStr(wcsSrc As PWSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
     228    Return GetStr(wcsSrc, len, mbsDst)
     229End Function
     230
     231Function GetMBStr(mbszSrc As PSTR, ByRef mbsDst As PSTR) As SIZE_T
     232    Return GetStr(mbszSrc, mbsDst)
     233End Function
     234
     235Function GetMBStr(mbsSrc As PSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
     236    Return GetStr(mbsSrc, len, mbsDst)
     237End Function
     238
     239Function GetMBStr(strSrc As String, ByRef mbsDst As PSTR) As SIZE_T
     240    Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, mbsDst)
     241End Function
     242
     243Function GetTCStr(mbszSrc As PSTR, ByRef tcsDst As PCTSTR) As SIZE_T
     244    Return GetStr(mbszSrc, tcsDst)
     245End Function
     246
     247Function GetTCStr(mbsSrc As PSTR, len As SIZE_T, ByRef tcsDst As PCTSTR) As SIZE_T
     248    Return GetStr(mbsSrc, len, tcsDst)
     249End Function
     250
     251Function GetTCStr(wcszSrc As PWSTR, ByRef tcsDst As PCTSTR) As SIZE_T
     252    Return GetStr(wcszSrc, tcsDst)
     253End Function
     254
     255Function GetTCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef tcsDst As PCTSTR) As SIZE_T
     256    Return GetStr(wcsSrc, len, tcsDst)
     257End Function
     258
     259Function GetTCStr(strSrc As String, ByRef tcsDst As PCTSTR) As SIZE_T
     260    Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, tcsDst)
     261End Function
     262
     263Function GetSCStr(mbszSrc As PSTR, ByRef ssDst As *StrChar) As SIZE_T
     264    Return GetStr(mbszSrc, ssDst)
     265End Function
     266
     267Function GetSCStr(mbsSrc As PSTR, len As SIZE_T, ByRef ssDst As *StrChar) As SIZE_T
     268    Return GetStr(mbsSrc, len, ssDst)
     269End Function
     270
     271Function GetSCStr(wcszSrc As PWSTR, ByRef ssDst As *StrChar) As SIZE_T
     272    Return GetStr(wcszSrc, ssDst)
     273End Function
     274
     275Function GetSCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef ssDst As *StrChar) As SIZE_T
     276    Return GetStr(wcsSrc, len, ssDst)
     277End Function
     278
     279Function GetSCStr(strSrc As String, ByRef ssDst As *StrChar) As SIZE_T
     280    Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, ssDst)
     281End Function
     282
     283Function ToWCStr(mbsz As PSTR) As PWSTR
     284    GetStrNT(mbsz, ToWCStr)
     285End Function
     286
     287Function ToWCStr(mbs As PSTR, len As SIZE_T) As PWSTR
     288    GetStrNT(mbs, len, ToWCStr)
     289End Function
     290
     291Function ToWCStr(wcsz As PWSTR) As PWSTR
     292    ToWCStr = wcsz
     293End Function
     294
     295Function ToWCStr(wcs As PWSTR, len As SIZE_T) As PWSTR
     296    ToWCStr = wcs
    203297End Function
    204298
    205299Function ToWCStr(s As String) As PWSTR
    206     GetStr(s.StrPtr, s.Length As SIZE_T, ToWCStr)
    207 End Function
    208 
    209 Function ToMBStr(psz As PSTR) As PSTR
    210     GetStr(psz, ToMBStr)
    211 End Function
    212 
    213 Function ToMBStr(psz As PSTR, len As SIZE_T) As PSTR
    214     GetStr(psz, len, ToMBStr)
    215 End Function
    216 
    217 Function ToMBStr(psz As PWSTR) As PSTR
    218     GetStr(psz, ToMBStr)
    219 End Function
    220 
    221 Function ToMBStr(psz As PWSTR, len As SIZE_T) As PSTR
    222     GetStr(psz, len, ToMBStr)
     300    GetStrNT(s, ToWCStr)
     301End Function
     302
     303Function ToMBStr(mbsz As PSTR) As PSTR
     304    ToMBStr = mbsz
     305End Function
     306
     307Function ToMBStr(mbs As PSTR, len As SIZE_T) As PSTR
     308    ToMBStr = mbs
     309End Function
     310
     311Function ToMBStr(wcsz As PWSTR) As PSTR
     312    GetStrNT(wcsz, ToMBStr)
     313End Function
     314
     315Function ToMBStr(wcs As PWSTR, len As SIZE_T) As PSTR
     316    GetStrNT(wcs, len, ToMBStr)
    223317End Function
    224318
    225319Function ToMBStr(s As String) As PSTR
    226     GetStr(s.StrPtr, s.Length As SIZE_T, ToMBStr)
    227 End Function
    228 
    229 Function ToTCStr(psz As PSTR) As PCTSTR
    230     GetStr(psz, ToTCStr)
    231 End Function
    232 
    233 Function ToTCStr(psz As PSTR, len As SIZE_T) As PCTSTR
    234     GetStr(psz, len, ToTCStr)
    235 End Function
    236 
    237 Function ToTCStr(psz As PWSTR) As PCTSTR
    238     GetStr(psz, ToTCStr)
    239 End Function
    240 
    241 Function ToTCStr(psz As PWSTR, len As SIZE_T) As PCTSTR
    242     GetStr(psz, len, ToTCStr)
     320    GetStrNT(s, ToMBStr)
     321End Function
     322
     323Function ToTCStr(mbsz As PSTR) As PCTSTR
     324    GetStrNT(mbsz, ToTCStr)
     325End Function
     326
     327Function ToTCStr(mbs As PSTR, len As SIZE_T) As PCTSTR
     328    GetStrNT(mbs, len, ToTCStr)
     329End Function
     330
     331Function ToTCStr(wcsz As PWSTR) As PCTSTR
     332    GetStrNT(wcsz, ToTCStr)
     333End Function
     334
     335Function ToTCStr(wcs As PWSTR, len As SIZE_T) As PCTSTR
     336    GetStrNT(wcs, len, ToTCStr)
    243337End Function
    244338
    245339Function ToTCStr(s As String) As PCTSTR
    246     GetStr(s.StrPtr, s.Length As SIZE_T, ToTCStr)
    247 End Function
    248 
    249 Function ToSCStr(psz As PSTR) As *StrChar
    250     GetStr(psz, ToSCStr)
    251 End Function
    252 
    253 Function ToSCStr(psz As PSTR, len As SIZE_T) As *StrChar
    254     GetStr(psz, len, ToSCStr)
    255 End Function
    256 
    257 Function ToSCStr(psz As PWSTR) As *StrChar
    258     GetStr(psz, ToSCStr)
    259 End Function
    260 
    261 Function ToSCStr(psz As PWSTR, len As SIZE_T) As *StrChar
    262     GetStr(psz, len, ToSCStr)
     340    GetStrNT(s, ToTCStr)
     341End Function
     342
     343Function ToSCStr(mbsz As PSTR) As *StrChar
     344    GetStrNT(mbsz, ToSCStr)
     345End Function
     346
     347Function ToSCStr(mbs As PSTR, len As SIZE_T) As *StrChar
     348    GetStrNT(mbs, len, ToSCStr)
     349End Function
     350
     351Function ToSCStr(wcsz As PWSTR) As *StrChar
     352    GetStrNT(wcsz, ToSCStr)
     353End Function
     354
     355Function ToSCStr(wcs As PWSTR, len As SIZE_T) As *StrChar
     356    GetStrNT(wcs, len, ToSCStr)
    263357End Function
    264358
    265359Function ToSCStr(s As String) As *StrChar
    266     GetStr(s.StrPtr, s.Length As SIZE_T, ToSCStr)
     360    ToSCStr = StrPtr(s)
    267361End Function
    268362
Note: See TracChangeset for help on using the changeset viewer.