System.Rtti.TValue

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

TValue = record

C++

struct __declspec(delphirecord) TValue
{
private:
    static TValue FEmpty;
private:
private:
    bool __fastcall GetIsEmpty();
    System::Typinfo::PTypeInfo __fastcall GetTypeInfo();
    System::Typinfo::TTypeKind __fastcall GetTypeKind();
    System::Typinfo::PTypeData __fastcall GetTypeDataProp();
    int __fastcall GetDataSize();
    static void __fastcall InitData(TValue &AValue);
    static TValue __fastcall Create(System::Typinfo::PTypeInfo ATypeInfo);
    static TValue __fastcall GetEmpty();
    bool __fastcall TryAsTypeInternal(void *AResult, System::Typinfo::PTypeInfo ATypeInfo, const bool EmptyAsAnyType = true);
    void __fastcall AsTypeInternal(void *AResult, void * ATypeInfo);
public:
    static TValue __fastcall _op_Implicit(const System::UnicodeString Value);
    static TValue __fastcall _op_Implicit(int Value);
    static TValue __fastcall _op_Implicit(unsigned Value);
    static TValue __fastcall _op_Implicit(float Value);
    static TValue __fastcall _op_Implicit(double Value);
    static TValue __fastcall _op_Implicit(System::Extended Value);
    static TValue __fastcall _op_Implicit(System::Currency Value);
    static TValue __fastcall _op_Implicit(__int64 Value);
    static TValue __fastcall _op_Implicit(unsigned __int64 Value);
    static TValue __fastcall _op_Implicit(System::TObject* Value);
    static TValue __fastcall _op_Implicit(System::TClass Value);
    static TValue __fastcall _op_Implicit(bool Value);
    static TValue __fastcall _op_Implicit(System::TDateTime Value);
    static TValue __fastcall _op_Implicit(const System::TVarRec &VarRec);
    static TValue __fastcall FromVariant(const System::Variant &Value, System::Typinfo::PTypeInfo ArrayTypeInfo = (System::Typinfo::PTypeInfo)(0x0));
    template<typename T> static TValue __fastcall From(const T Value);
    static TValue __fastcall FromOrdinal(System::Typinfo::PTypeInfo ATypeInfo, __int64 AValue);
    static TValue __fastcall FromArray(System::Typinfo::PTypeInfo ArrayTypeInfo, const TValue *Values, const System::NativeInt Values_High);
    static TValue __fastcall FromVarRec(const System::TVarRec &VarRec);
    __property System::Typinfo::TTypeKind Kind = {read=GetTypeKind};
    __property System::Typinfo::PTypeInfo TypeInfo = {read=GetTypeInfo};
    __property System::Typinfo::PTypeData TypeData = {read=GetTypeDataProp};
    __property bool IsEmpty = {read=GetIsEmpty};
    bool __fastcall IsObject();
    bool __fastcall IsObjectInstance();
    System::TObject* __fastcall AsObject();
    bool __fastcall IsInstanceOf(System::TClass AClass);
    bool __fastcall IsClass();
    System::TClass __fastcall AsClass();
    bool __fastcall IsOrdinal();
    __int64 __fastcall AsOrdinal();
    bool __fastcall TryAsOrdinal(/* out */ __int64 &AResult);
    template<typename T> bool __fastcall IsType(const bool EmptyAsAnyType = true)/* overload */;
    bool __fastcall IsType(System::Typinfo::PTypeInfo ATypeInfo, const bool EmptyAsAnyType = true)/* overload */;
    template<typename T> T __fastcall AsType(const bool EmptyAsAnyType = true);
    template<typename T> bool __fastcall TryAsType(/* out */ T &AResult, const bool EmptyAsAnyType = true);
    template<typename T> TValue __fastcall Cast(const bool EmptyAsAnyType = true)/* overload */;
    TValue __fastcall Cast(System::Typinfo::PTypeInfo ATypeInfo, const bool EmptyAsAnyType = true)/* overload */;
    bool __fastcall TryCast(System::Typinfo::PTypeInfo ATypeInfo, /* out */ TValue &AResult, const bool EmptyAsAnyType = true);
    int __fastcall AsInteger();
    bool __fastcall AsBoolean();
    System::Extended __fastcall AsExtended();
    __int64 __fastcall AsInt64();
    unsigned __int64 __fastcall AsUInt64();
    System::_di_IInterface __fastcall AsInterface();
    System::UnicodeString __fastcall AsString();
    System::Variant __fastcall AsVariant();
    System::Currency __fastcall AsCurrency();
    bool __fastcall IsArray();
    TValue __fastcall CastToVarRec();
    System::TVarRec __fastcall AsVarRec();
    System::NativeInt __fastcall GetArrayLength();
    TValue __fastcall GetArrayElement(System::NativeInt Index);
    void __fastcall SetArrayElement(System::NativeInt Index, const TValue &AValue);
    static void __fastcall Make(void * ABuffer, System::Typinfo::PTypeInfo ATypeInfo, TValue &Result)/* overload */;
    static void __fastcall Make(System::NativeInt AValue, System::Typinfo::PTypeInfo ATypeInfo, TValue &Result)/* overload */;
    template<typename T> static void __fastcall Make(const T Value, TValue &Result)/* overload */;
    static void __fastcall MakeWithoutCopy(void * ABuffer, System::Typinfo::PTypeInfo ATypeInfo, TValue &Result, bool IsMoved = false)/* overload */;
    __property int DataSize = {read=GetDataSize};
    void __fastcall ExtractRawData(void * ABuffer);
    void __fastcall ExtractRawDataNoCopy(void * ABuffer);
    void * __fastcall GetReferenceToRawData();
    void * __fastcall GetReferenceToRawArrayElement(System::NativeInt Index);
    /* static */ __property TValue Empty = {read=GetEmpty};
    System::UnicodeString __fastcall ToString(const System::Sysutils::TFormatSettings &AFormatSettings)/* overload */;
    System::UnicodeString __fastcall ToString()/* overload */;
private:
    System::Typinfo::PTypeInfo FTypeInfo;
    _di_IValueData FValueData;
public:
    TValue& operator =(const System::UnicodeString Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(int Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(unsigned Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(float Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(double Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(System::Extended Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(System::Currency Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(__int64 Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(unsigned __int64 Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(System::TObject* Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(System::TClass Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(bool Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(System::TDateTime Value) { *this = TValue::_op_Implicit(Value); return *this; }
    TValue& operator =(const System::TVarRec &VarRec) { *this = TValue::_op_Implicit(VarRec); return *this; }
private:
    union
    {
        struct
        {
            void *FAsPointer;
        };
        struct
        {
            System::TMethod FAsMethod;
        };
        struct
        {
            __int64 FAsSInt64;
        };
        struct
        {
            unsigned __int64 FAsUInt64;
        };
        struct
        {
            System::CurrencyBase FAsCurr;
        };
        struct
        {
            System::CompBase FAsComp;
        };
        struct
        {
            System::Extended FAsExtended;
        };
        struct
        {
            double FAsDouble;
        };
        struct
        {
            float FAsSingle;
        };
        struct
        {
            int FAsSLong;
        };
        struct
        {
            short FAsSWord;
        };
        struct
        {
            System::Int8 FAsSByte;
        };
        struct
        {
            System::TClass FAsClass;
        };
        struct
        {
            void *FAsObject;
        };
        struct
        {
            unsigned FAsULong;
        };
        struct
        {
            System::Word FAsUWord;
        };
        struct
        {
            System::Byte FAsUByte;
        };
    };
};

Propriétés

Type Visibilité  Source Unité  Parent
record
struct
public
System.Rtti.pas
System.Rtti.hpp
System.Rtti System.Rtti

Description

Représente une version légère du type Variant.

TValue est une structure de données qui peut stocker différentes sortes de types de données. TValue est utilisé dans l'unité Rtti pour faciliter l'accès aux champs et aux paramètres des méthodes.

Voir aussi