Ignore:
Timestamp:
Mar 28, 2008, 5:43:34 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

インクルードガードとその他不要な前処理定義などの削除

Location:
trunk/Include/Classes/System
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/Data/Odbc/Odbc.ab

    r1 r497  
    11' odbc.sbp
    22
    3 #ifndef _INC_SQLEXT
    4 #include <api_sqlext.sbp>
    5 #endif
    6 
    7 
     3#require <api_sqlext.sbp>
    84
    95'===========================================================
     
    143139
    144140        'ステートメントハンドルを取得する
    145         SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt ) 
     141        SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt )
    146142
    147143        'SQL文を発行
     
    154150
    155151        'ステートメントハンドルを取得する
    156         SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt ) 
     152        SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt )
    157153
    158154        Prepare = SQLPrepare( hStmt, lpszSQL, SQL_NTS ) 'SQL文を設定する
     
    244240        SQLAllocHandle( SQL_HANDLE_STMT,
    245241            pobj_Command->pobj_Connection->GetDbcHandle(),
    246             hStmt ) 
     242            hStmt )
    247243
    248244        'SQL文を発行
  • trunk/Include/Classes/System/Drawing/CharacterRange.ab

    r473 r497  
    11' Classes/System/Drawing/CharacterRange.ab
    2 
    3 #ifndef __SYSTEM_DRAWING_CHARACTERRANGE_AB__
    4 #define __SYSTEM_DRAWING_CHARACTERRANGE_AB__
    52
    63Class CharacterRange
     
    5249    length As Long
    5350End Class
    54 
    55 #endif '__SYSTEM_DRAWING_CHARACTERRANGE_AB__
  • trunk/Include/Classes/System/Drawing/Color.ab

    r473 r497  
    11' Classes/System/Drawing/Color.ab
    22
    3 #ifndef __SYSTEM_DRAWING_COLOR_AB__
    4 #define __SYSTEM_DRAWING_COLOR_AB__
    5 
    6 #include <Classes/System/Drawing/Imaging/misc.ab>
     3#require <Classes/System/Drawing/Imaging/misc.ab>
    74
    85Class Color
     
    309306    argb As ARGB
    310307End Class
    311 
    312 #endif '__SYSTEM_DRAWING_COLOR_AB__
  • trunk/Include/Classes/System/Drawing/Drawing2D/Matrix.ab

    r77 r497  
    11' Classes/System/Drawing/Drawing2D/Matrix.ab
    2 
    3 #ifndef __SYSTEM_DRAWING_DRAWING2D_MATRIX_AB__
    4 #define __SYSTEM_DRAWING_DRAWING2D_MATRIX_AB__
    52
    63Class Matrix
    74End Class
    8 
    9 #endif '__SYSTEM_DRAWING_DRAWING2D_MATRIX_AB__
  • trunk/Include/Classes/System/Drawing/Drawing2D/misc.ab

    r77 r497  
    11' Classes/System/Drawing/Drawing2D/misc.ab
    2 
    3 #ifndef __SYSTEM_DRAWING_DRAWING2D_MISC_AB__
    4 #define __SYSTEM_DRAWING_DRAWING2D_MISC_AB__
    52
    63Enum CombineMode
     
    8481    Device
    8582End Enum
    86 
    87 #endif '__SYSTEM_DRAWING_DRAWING2D_MISC_AB__
  • trunk/Include/Classes/System/Drawing/Font.ab

    r473 r497  
    250250
    251251    Const Function Name() As String
    252 #ifdef __STRING_IS_NOT_UNICODE
     252#ifdef UNICODE
     253        Dim lf As LOGFONTW
     254        GetLogFontW(0, lf)
     255#else
    253256        Dim lf As LOGFONTA
    254257        GetLogFontA(0, lf)
    255 #else
    256         Dim lf As LOGFONTW
    257         GetLogFontW(0, lf)
    258258#endif
    259259        Return lf.lfFaceName
  • trunk/Include/Classes/System/Drawing/Graphics.ab

    r473 r497  
    11' Classes/System/Drawing/Graphics.ab
    2 
    3 #ifndef __SYSTEM_DRAWING_GRAPHICS_AB__
    4 #define __SYSTEM_DRAWING_GRAPHICS_AB__
    52
    63Class Brush : End Class
     
    20112008End Class
    20122009
    2013 #endif
  • trunk/Include/Classes/System/Drawing/Imaging/MetafileHeader.ab

    r12 r497  
    11' Classes/System/Drawing/Imaging/MetafileHeader.ab
    2 
    3 #ifndef __SYSTEM_DRAWING_IMAGING_METAFILEHEADER_AB__
    4 #define __SYSTEM_DRAWING_IMAGING_METAFILEHEADER_AB__
    52
    63Type Align(8) ENHMETAHEADER3
     
    154151    End Function
    155152End Class
    156 
    157 #endif '__SYSTEM_DRAWING_IMAGING_METAFILEHEADER_AB__
  • trunk/Include/Classes/System/Drawing/Imaging/misc.ab

    r447 r497  
    11' Classes/System/Drawing/Imaging/misc.ab
    22
    3 #ifndef __SYSTEM_DRAWING_IMAGING_MISC_AB__
    4 #define __SYSTEM_DRAWING_IMAGING_MISC_AB__
    5 
    6 #include <Classes/System/Drawing/Color.ab>
     3#require <Classes/System/Drawing/Color.ab>
    74
    85TypeDef ARGB = DWord
     
    436433    ColorChannelLast
    437434End Enum
    438 
    439 #endif '__SYSTEM_DRAWING_IMAGING_MISC_AB__
  • trunk/Include/Classes/System/Drawing/Text/misc.ab

    r77 r497  
    11' Classes/System/Drawing/Text/misc.ab
    2 
    3 #ifndef __SYSTEM_DRAWING_TEXT_MISC_AB__
    4 #define __SYSTEM_DRAWING_TEXT_MISC_AB__
    52
    63Enum TextRenderingHint
     
    129    ClearTypeGridFit
    1310End Enum
    14 
    15 #endif '__SYSTEM_DRAWING_TEXT_MISC_AB__
  • trunk/Include/Classes/System/Environment.ab

    r427 r497  
    2020    Static Function CommandLine() As String
    2121        If Object.ReferenceEquals(cmdLine, Nothing) Then
    22 #ifdef __STRING_IS_NOT_UNICODE
     22#ifdef UNICODE
     23            cmdLine = New String(GetCommandLineW())
     24#else
    2325            cmdLine = New String(GetCommandLineA())
    24 #else
    25             cmdLine = New String(GetCommandLineW())
    2626#endif
    2727        End If
     
    120120Public
    121121    'NTでしか使用できない仕様
    122     Static Function WorkingSet() As Int64
     122    Static Function WorkingSet() As SIZE_T
    123123        Dim hmodPSAPI = LoadLibrary("PSAPI.DLL")
    124124        If hmodPSAPI = 0 Then Return 0
     
    141141
    142142    Static Function ExpandEnvironmentVariables(s As String) As String
     143        If ActiveBasic.IsNothing(s) Then
     144            Throw New ArgumentNullException("s")
     145        End If
    143146        Dim src = ToTCStr(s)
    144147        Dim size = ExpandEnvironmentStrings(src, 0, 0)
    145         Dim dst = GC_malloc_atomic(SizeOf (TCHAR) * size) As PTSTR
    146         ExpandEnvironmentStrings(src, dst, size)
    147         ExpandEnvironmentVariables = New String(dst, size - 1)
     148        Dim dst = New Text.StringBuilder
     149        dst.Length = size As Long
     150        ExpandEnvironmentStrings(src, StrPtr(dst), size)
     151        dst.Length = (size - 1) As Long
     152        ExpandEnvironmentVariables = dst.ToString
    148153    End Function
    149154
     
    155160
    156161    Static Function GetEnvironmentVariable(variable As String) As String
     162        If ActiveBasic.IsNothing(variable) Then
     163            Throw New ArgumentNullException("variable")
     164        End If
    157165        Dim tcsVariable = ToTCStr(variable)
    158166        Dim size = _System_GetEnvironmentVariable(tcsVariable, 0, 0)
    159         Dim p = GC_malloc_atomic(SizeOf (TCHAR) * size) As PTSTR
    160         Dim len = _System_GetEnvironmentVariable(tcsVariable, p, size)
    161         GetEnvironmentVariable = New String(p, len As Long)
     167        Dim buf = New Text.StringBuilder
     168        buf.Length = size As Long
     169        buf.Length  = _System_GetEnvironmentVariable(tcsVariable, StrPtr(buf), size)
     170        GetEnvironmentVariable = buf.ToString
    162171    End Function
    163172
     
    176185
    177186    Static Sub SetEnvironmentVariable(variable As String, value As String)
     187        If ActiveBasic.IsNothing(variable) Then
     188            Throw New ArgumentNullException("variable")
     189        End If
    178190        _System_SetEnvironmentVariable(ToTCStr(variable), ToTCStr(value))
    179191    End Sub
  • trunk/Include/Classes/System/IO/Path.ab

    r469 r497  
    1010Class Path
    1111Public
    12     Static Const AltDirectorySeparatorChar = &H2F As StrChar '/
    13     Static Const DirectorySeparatorChar    = &H5C As StrChar '\
    14     Static Const PathSeparator             = &H3B As StrChar ';
    15     Static Const VolumeSeparatorChar       = &H3A As StrChar ':
     12    Static Const AltDirectorySeparatorChar = &H2F As Char '/
     13    Static Const DirectorySeparatorChar    = &H5C As Char '\
     14    Static Const PathSeparator             = &H3B As Char ';
     15    Static Const VolumeSeparatorChar       = &H3A As Char ':
    1616
    1717    '----------------------------------------------------------------
     
    135135        If IsPathRooted(path) Then
    136136            If path.Contains(UniformNamingConventionString) Then
    137                 Return path.Remove(path.IndexOf(DirectorySeparatorChar, 
     137                Return path.Remove(path.IndexOf(DirectorySeparatorChar,
    138138                                                      UniformNamingConventionString.Length) + 1)
    139139            Else
     
    214214
    215215Private
    216     Static Const ExtensionSeparatorChar = &H2E As StrChar
     216    Static Const ExtensionSeparatorChar = &H2E As Char
    217217    Static Const InvalidPathChars = Ex"\q<>|\0\t" As String
    218218    Static Const UniformNamingConventionString = "\\" As String
     
    258258    */
    259259    Static Function GetLastSeparatorIndex(path As String) As Long
    260         Return System.Math.Max(path.LastIndexOf(DirectorySeparatorChar), 
     260        Return System.Math.Max(path.LastIndexOf(DirectorySeparatorChar),
    261261                               path.LastIndexOf(AltDirectorySeparatorChar)) As Long
    262262    End Function
  • trunk/Include/Classes/System/IO/StreamReader.ab

    r435 r497  
    9393    @auther Egtra
    9494    */
    95     Override Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
     95    Override Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
    9696        Dim n = last - cur
    9797        If count <= n Then
     
    143143    文字数が足りなくても、元のストリームまで読みには行かない。
    144144    */
    145     Function ReadFromBuffer(p As *StrChar, index As Long, count As Long) As Long
    146         memcpy(VarPtr(p[index]), VarPtr(buf[cur]), count * SizeOf (StrChar))
     145    Function ReadFromBuffer(p As *Char, index As Long, count As Long) As Long
     146        memcpy(VarPtr(p[index]), VarPtr(buf[cur]), count * SizeOf (Char))
    147147        cur += count
    148148        ReadFromBuffer = count
  • trunk/Include/Classes/System/IO/StringReader.ab

    r432 r497  
    7575    @auther Egtra
    7676    */
    77     Override Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
     77    Override Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
    7878        ReadImpl = Math.Min(count, s.Length - i)
    79         ActiveBasic.Strings.ChrCopy(VarPtr(buffer[index]) As *StrChar, (StrPtr(s) + i * SizeOf (StrChar)) As *StrChar, ReadImpl As SIZE_T) 'ToDo: ポインタに対する+演算
     79        ActiveBasic.Strings.ChrCopy(VarPtr(buffer[index]) As *Char, (StrPtr(s) + i * SizeOf (Char)) As *Char, ReadImpl As SIZE_T) 'ToDo: ポインタに対する+演算
    8080    End Function
    8181
  • trunk/Include/Classes/System/IO/TextReader.ab

    r473 r497  
    3131    @auther Egtra
    3232    */
    33     Function Read(buffer As *StrChar, index As Long, count As Long) As Long
     33    Function Read(buffer As *Char, index As Long, count As Long) As Long
    3434        If buffer = 0 Then
    3535        ElseIf index < 0 Then
     
    7676'                   Exit Do
    7777            End Select
    78             sb.Append(ch As StrChar) 'ToDo キャスト不要にすべきというチケットを書くこと
     78            sb.Append(ch As Char) 'ToDo キャスト不要にすべきというチケットを書くこと
    7979        Loop
    8080        ReadLine = sb.ToString
     
    9393                Exit Function
    9494            End If
    95             sb.Append(ch As StrChar)
     95            sb.Append(ch As Char)
    9696        Loop
    9797    End Function
     
    109109    @auther Egtra
    110110    */
    111     Virtual Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
     111    Virtual Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
    112112        Dim i As Long
    113113        Dim p = VarPtr(buffer[index])
     
    118118                Exit Function
    119119            Else
    120                 p[i] = c As StrChar
     120                p[i] = c As Char
    121121            End If
    122122        Next
     
    171171    End Sub
    172172
    173     Override Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
     173    Override Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
    174174'       Using lock = cs.Lock
    175175            ReadImpl = base.ReadImpl(buffer, index, count)
  • trunk/Include/Classes/System/Math.ab

    r457 r497  
    22
    33#require <Classes/ActiveBasic/Math/Math.ab>
    4 
    5 #ifndef __SYSTEM_MATH_AB__
    6 #define __SYSTEM_MATH_AB__
    74
    85Namespace System
     
    600597Const _System_InverseLn10 = 0.43429448190325182765112891891661 '1 / (ln 10)
    601598Const _System_InverseSqrt2 = 0.70710678118654752440084436210485 '1 / (√2)
    602 
    603 #endif '__SYSTEM_MATH_AB__
  • trunk/Include/Classes/System/OperatingSystem.ab

    r258 r497  
    11' Classes/System/OperatingSystem.ab
    2 
    3 #ifndef __SYSYTEM_OPERATINGSYSTEM_AB__
    4 #define __SYSYTEM_OPERATINGSYSTEM_AB__
    52
    63#require <Classes/System/Version.ab>
     
    8683
    8784End Namespace
    88 
    89 #endif '__SYSYTEM_OPERATINGSYSTEM_AB__
  • trunk/Include/Classes/System/String.ab

    r478 r497  
    11' Classes/System/String.ab
    2 
    3 #require <basic/function.sbp>
    4 #require <Classes/System/Text/StringBuilder.ab>
    5 #require <Classes/ActiveBasic/Strings/Strings.ab>
    6 
    7 TypeDef StrChar = Char
    8 
    9 #ifdef UNICODE
    10 #define __STRING_IS_UNICODE
    11 #else
    12 #define __STRING_IS_NOT_UNICODE
    13 #endif
    142
    153Namespace System
     
    270258
    271259        Sub Assign(text As PCSTR, textLengthA As Long)
    272 #ifdef __STRING_IS_NOT_UNICODE
    273             AssignFromCharPtr(text, textLengthA)
    274 #else
     260#ifdef UNICODE
    275261            Dim textLengthW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, 0, 0)
    276262            If AllocStringBuffer(textLengthW) <> 0 Then
     
    278264                Chars[textLengthW] = 0
    279265            End If
     266#else
     267            AssignFromCharPtr(text, textLengthA)
    280268#endif
    281269        End Sub
    282270
    283271        Sub Assign(text As PCWSTR, textLengthW As Long)
    284 #ifdef __STRING_IS_NOT_UNICODE
     272#ifdef UNICODE
     273            AssignFromCharPtr(text, textLengthW)
     274#else
    285275            Dim textLengthA = WideCharToMultiByte(CP_THREAD_ACP, 0, text, textLengthW, 0, 0, 0, 0)
    286276            If AllocStringBuffer(textLengthA) <> 0 Then
     
    288278                Chars[textLengthA] = 0
    289279            End If
    290 #else
    291             AssignFromCharPtr(text, textLengthW)
    292280#endif
    293281        End Sub
     
    305293    Public
    306294        Const Function Concat(text As PCSTR, len As Long) As String
    307 #ifdef __STRING_IS_NOT_UNICODE
    308             Return ConcatChar(This.Chars, m_Length, text, len)
    309 #else
     295#ifdef UNICODE
    310296            With Concat
    311297                Dim lenW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, len, 0, 0)
     
    316302                .Chars[m_Length + lenW] = 0
    317303            End With
     304#else
     305            Return ConcatChar(This.Chars, m_Length, text, len)
    318306#endif
    319307        End Function
    320308
    321309        Const Function Concat(text As PCWSTR, len As Long) As String
    322 #ifdef __STRING_IS_NOT_UNICODE
     310#ifdef UNICODE
     311            Return ConcatChar(This.Chars, m_Length, text, len)
     312#else
    323313            With Concat
    324314                Concat = New String
     
    329319                .Chars[m_Length + lenA] = 0
    330320            End With
    331 #else
    332             Return ConcatChar(This.Chars, m_Length, text, len)
    333321#endif
    334322        End Function
     
    600588
    601589        Override Function GetHashCode() As Long
    602 #ifdef __STRING_IS_NOT_UNICODE
     590#ifdef UNICODE
     591            Dim size = m_Length
     592#else
    603593            Dim size = (m_Length + 1) >> 1
    604 #else
    605             Dim size = m_Length
    606594#endif
    607595            Return _System_GetHashFromWordArray(Chars As *Word, size) Xor m_Length
  • trunk/Include/Classes/System/Text/DecoderFallback.ab

    r411 r497  
    7777        len = length
    7878    End Sub
    79 #ifndef __STRING_IS_NOT_UNICODE
     79#ifdef UNICODE
    8080    /*!
    8181    @brief  指定された文字列でDecoderReplacementFallbackを構築する。
     
    124124    End Function
    125125
    126 #ifndef __STRING_IS_NOT_UNICODE
     126#ifdef UNICODE
    127127    /*!
    128128    @brief  代替文字列を返す
     
    167167        End If
    168168    End Sub
    169 #ifndef __STRING_IS_NOT_UNICODE
     169#ifdef UNICODE
    170170    /*!
    171171    @brief  指定された文字列でDecoderReplacementFallbackを構築する。
  • trunk/Include/Classes/System/Text/Encoding.ab

    r411 r497  
    1 #define __STRING_IS_NOT_UNICODE 'なぜか認識されないので
    2 
    31/*!
    42@file   Classes/System/Text/Encoding.ab
     
    5250        Return GetBytesCountCore(s, n)
    5351    End Function
    54 #ifndef __STRING_IS_NOT_UNICODE
     52#ifdef UNICODE
    5553    /*!
    5654    @brief  符号化して得られる文字列の長さを計算する。
     
    141139        Return GetBytesCore(VarPtr(chars[index]), count, bytes, byteCount)
    142140    End Function
    143 #ifndef __STRING_IS_NOT_UNICODE
     141#ifdef UNICODE
    144142    /*!
    145143    @brief  符号化する。
     
    289287    Abstract Function GetCharsCore(bytes As *Byte, byteCount As Long, chars As *WCHAR, charCount As Long) As Long
    290288Public
    291 #ifndef __STRING_IS_NOT_UNICODE
     289#ifdef UNICODE
    292290    /*!
    293291    @brief  復号し、Stringで結果を返す。
  • trunk/Include/Classes/System/Text/StringBuilder.ab

    r468 r497  
    11'Classes/System/Text/StringBuilder.ab
    2 
    3 #require <Classes/ActiveBasic/Strings/Strings.ab>
    42
    53Namespace System
     
    75
    86Class StringBuilder
    9     'Inherits ISerializable
    107Public
    118    Sub StringBuilder()
     
    196193
    197194    Override Function GetHashCode() As Long
    198 #ifdef __STRING_IS_NOT_UNICODE
     195#ifdef UNICODE
     196        Dim n = size
     197#else
    199198        Dim n = (size + 1) >> 1
    200 #else
    201         Dim n = size
    202199#endif
    203200        Return _System_GetHashFromWordArray(chars As *Word, n As SIZE_T) Xor capacity Xor maxCapacity
     
    214211        Return This
    215212    End Function
    216 #ifdef __STRING_IS_NOT_UNICODE
     213#ifdef UNICODE
     214    Function Insert(i As Long, x As SByte) As StringBuilder
     215        rangeCheck(i)
     216        insertCore(i, Str$(x As Long))
     217        Return This
     218    End Function
     219#else
    217220    Function Insert(i As Long, x As Word) As StringBuilder
    218221        rangeCheck(i)
    219222        insertCore(i, Str$(x As DWord))
    220         Return This
    221     End Function
    222 #else
    223     Function Insert(i As Long, x As SByte) As StringBuilder
    224         rangeCheck(i)
    225         insertCore(i, Str$(x As Long))
    226223        Return This
    227224    End Function
  • trunk/Include/Classes/System/Threading/Timeout.ab

    r419 r497  
    11' Classes/System/Threading/Timeout.ab
    2 
    3 #ifndef __SYSTEM_THREADING_TIMEOUT_AB__
    4 #define __SYSTEM_THREADING_TIMEOUT_AB__
    52
    63Namespace System
     
    1411End Namespace 'Threading
    1512End Namespace 'System
    16 
    17 #endif
  • trunk/Include/Classes/System/Version.ab

    r257 r497  
    1 ' System/Version.ab
    2 
    3 #ifndef __SYSTEM_VERSION_AB__
    4 #define __SYSTEM_VERSION_AB__
    5 
    6 #require <api_winsock2.sbp>
     1' Classes/System/Version.ab
    72
    83Namespace System
     
    121116    Function ToString(fieldCount As Long) As String
    122117        If fieldCount < 0 Or fieldCount > 4 Then
    123             ' Throw ArgumentException
    124             Debug
     118            Throw New ArgumentOutOfRangeException("fieldCount")
    125119        End If
    126120        ToString = ""
     
    132126
    133127        If build < 0 Then
    134             ' Throw ArgumentException
    135             Debug
     128            Throw New ArgumentException
    136129        End If
    137130        ToString = ToString + "." + Str$(build)
     
    139132
    140133        If revision < 0 Then
    141             ' Throw ArgumentException
    142             Debug
     134            Throw New ArgumentException
    143135        End If
    144136        ToString = ToString + "." + Str$(revision)
     
    152144
    153145End Namespace 'System
    154 
    155 #endif '__SYSTEM_VERSION_AB__
  • trunk/Include/Classes/System/Xml/XmlDocument.ab

    r468 r497  
    9999    Virtual Sub Load( inStream As System.IO.Stream )
    100100        Dim length = inStream.Length As DWord
    101         Dim xmlBuffer = calloc( length + 1 ) As *StrChar
     101        Dim xmlBuffer = calloc( length + 1 ) As *Char
    102102        inStream.Read( xmlBuffer As *Byte, 0, length )
    103103        inStream.Close()
     
    124124    Virtual Sub Save( outStream As System.IO.Stream )
    125125        Dim xmlStr = InnerXmlSupportedIndent( True )
    126         outStream.Write( xmlStr.StrPtr As *Byte, 0, xmlStr.Length * SizeOf( StrChar ) )
     126        outStream.Write( xmlStr.StrPtr As *Byte, 0, xmlStr.Length * SizeOf( Char ) )
    127127        outStream.Close()
    128128    End Sub
Note: See TracChangeset for help on using the changeset viewer.