Ignore:
Timestamp:
Jun 12, 2007, 7:24:38 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

StringBuilderを追加。String不変へ。共通の文字列操作関数をActiveBasic.Strings内に配置(設計に検討の余地あり)。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/system/string.sbp

    r258 r272  
    55#define _INC_BASIC_STRING
    66
    7 Function StrPtr(buf As *StrChar) As *StrChar
    8     StrPtr = buf
     7Function StrPtr(s As String) As *StrChar
     8    StrPtr = s.StrPtr
    99End Function
    1010
     
    9393
    9494Function GetStr(s As String, ByRef mbs As PSTR) As SIZE_T
    95     Return GetStr(s.Chars, s.Length As SIZE_T, mbs)
     95    Return GetStr(s.StrPtr, s.Length As SIZE_T, mbs)
    9696End Function
    9797
    9898Function GetStr(s As String, ByRef wcs As PWSTR) As SIZE_T
    99     Return GetStr(s.Chars, s.Length As SIZE_T, wcs)
     99    Return GetStr(s.StrPtr, s.Length As SIZE_T, wcs)
    100100End Function
    101101
     
    117117
    118118Function GetWCStr(s As String, ByRef wcs As PWSTR) As SIZE_T
    119     Return GetStr(s.Chars, s.Length As SIZE_T, wcs)
     119    Return GetStr(s.StrPtr, s.Length As SIZE_T, wcs)
    120120End Function
    121121
     
    137137
    138138Function GetMBStr(s As String, ByRef mbs As PSTR) As SIZE_T
    139     Return GetStr(s.Chars, s.Length As SIZE_T, mbs)
     139    Return GetStr(s.StrPtr, s.Length As SIZE_T, mbs)
    140140End Function
    141141
     
    157157
    158158Function GetTCStr(s As String, ByRef tcs As PCTSTR) As SIZE_T
    159     Return GetStr(s.Chars, s.Length As SIZE_T, tcs)
     159    Return GetStr(s.StrPtr, s.Length As SIZE_T, tcs)
    160160End Function
    161161
     
    177177
    178178Function GetSCStr(s As String, ByRef ss As *StrChar) As SIZE_T
    179     Return GetStr(s.Chars, s.Length As SIZE_T, ss)
     179    Return GetStr(s.StrPtr, s.Length As SIZE_T, ss)
    180180End Function
    181181
     
    197197
    198198Function ToWCStr(s As String) As PWSTR
    199     GetStr(s.Chars, s.Length As SIZE_T, ToWCStr)
     199    GetStr(s.StrPtr, s.Length As SIZE_T, ToWCStr)
    200200End Function
    201201
     
    217217
    218218Function ToMBStr(s As String) As PSTR
    219     GetStr(s.Chars, s.Length As SIZE_T, ToMBStr)
     219    GetStr(s.StrPtr, s.Length As SIZE_T, ToMBStr)
    220220End Function
    221221
     
    237237
    238238Function ToTCStr(s As String) As PCTSTR
    239     GetStr(s.Chars, s.Length As SIZE_T, ToTCStr)
     239    GetStr(s.StrPtr, s.Length As SIZE_T, ToTCStr)
    240240End Function
    241241
     
    257257
    258258Function ToSCStr(s As String) As *StrChar
    259     GetStr(s.Chars, s.Length As SIZE_T, ToSCStr)
     259    GetStr(s.StrPtr, s.Length As SIZE_T, ToSCStr)
    260260End Function
    261261
Note: See TracChangeset for help on using the changeset viewer.