zoukankan      html  css  js  c++  java
  • XE里, TStringField 还是 ansi的

    { TStringField }
    
      TStringField = class(TField)
      private
        FFixedChar: Boolean;
        FTransliterate: Boolean;
      protected
        class procedure CheckTypeSize(Value: Integer); override;
        function GetAsBCD: TBcd; override;
        function GetAsBoolean: Boolean; override;
        function GetAsDateTime: TDateTime; override;
        function GetAsSingle: Single; override;
        function GetAsFloat: Double; override;
        function GetAsExtended: Extended; override;
        function GetAsInteger: Longint; override;
        function GetAsLargeInt: Largeint; override;
        function GetAsSQLTimeStamp: TSQLTimeStamp; override;
        function GetAsString: string; override;
        function GetAsAnsiString: AnsiString; override;
        function GetAsVariant: Variant; override;
        function GetDataSize: Integer; override;
        function GetDefaultWidth: Integer; override;
        procedure GetText(var Text: string; DisplayText: Boolean); override;
        function GetValue(var Value: AnsiString): Boolean;
        procedure SetAsBCD(const Value: TBcd); override;
        procedure SetAsBoolean(Value: Boolean); override;
        procedure SetAsDateTime(Value: TDateTime); override;
        procedure SetAsSingle(Value: Single); override;
        procedure SetAsFloat(Value: Double); override;
        procedure SetAsExtended(Value: Extended); override;
        procedure SetAsInteger(Value: Longint); override;
        procedure SetAsLargeInt(Value: Largeint); override;
        procedure SetAsSQLTimeStamp(const Value: TSQLTimeStamp); override;
        procedure SetAsString(const Value: string); override;
        procedure SetAsAnsiString(const Value: AnsiString); override;
        procedure SetVarValue(const Value: Variant); override;
      public
        constructor Create(AOwner: TComponent); override;
        property Value: AnsiString read GetAsAnsiString write SetAsAnsiString;
      published
        property EditMask;
        property FixedChar: Boolean read FFixedChar write FFixedChar default False;
        property Size default 20;
        property Transliterate: Boolean read FTransliterate write FTransliterate default True;
      end;
    
    { TWideStringField }
    
      TWideStringField = class(TStringField)
      protected
        class procedure CheckTypeSize(Value: Integer); override;
        procedure CopyData(Source, Dest: Pointer); override;
        function GetAsAnsiString: AnsiString; override;
        function GetAsString: string; override;
        function GetAsVariant: Variant; override;
        function GetAsWideString: UnicodeString; override;
        function GetDataSize: Integer; override;
        procedure GetText(var Text: string; DisplayText: Boolean); override;
        function GetValue(var Value: UnicodeString): Boolean;
        procedure SetAsAnsiString(const Value: AnsiString); override;
        procedure SetAsString(const Value: string); override;
        procedure SetVarValue(const Value: Variant); override;
        procedure SetAsWideString(const Value: UnicodeString); override;
      public
        constructor Create(AOwner: TComponent); override;
        property Value: UnicodeString read GetAsWideString write SetAsWideString;
      end;
  • 相关阅读:
    HDU 5698 瞬间移动
    HDU 5695 Gym Class
    HDU 5694 BD String
    HDU 5692 Snacks
    HDU 5691 Sitting in Line
    胜利大逃亡
    BFS(广度优先搜索)
    计算直线的交点数
    Division
    Jesse's Code
  • 原文地址:https://www.cnblogs.com/CodeGear/p/4542709.html
Copyright © 2011-2022 走看看