System.SysUtils.TMarshaller

Aus RAD Studio API Documentation
Wechseln zu: Navigation, Suche

Delphi

TMarshaller = record

C++

struct DECLSPEC_DRECORD TMarshaller
{
private:
    struct TDisposeRec;
    typedef TDisposeRec *PDisposeRec;
    typedef void __fastcall (*TDisposeProc)(PDisposeRec Args);
    struct DECLSPEC_DRECORD TDisposeRec
    {
    public:
        TMarshaller::TDisposeProc Proc;
        System::TObject* Obj;
        System::NativeInt Arg1;
        System::NativeInt Arg2;
    };
    __interface DELPHIINTERFACE IDisposer;
    typedef System::DelphiInterface<IDisposer> _di_IDisposer;
    __interface IDisposer  : public System::IInterface
    {
        virtual void __fastcall AddDispose(const TMarshaller::TDisposeRec &Rec) = 0 ;
        virtual void __fastcall RemoveDispose(const TMarshaller::TDisposeRec &Rec) = 0 ;
        virtual void __fastcall Flush() = 0 ;
    };
    class DELPHICLASS TDisposer;
#ifndef _WIN64
    #pragma pack(push,4)
#endif /* not _WIN64 */
    class PASCALIMPLEMENTATION TDisposer : public System::TInterfacedObject
    {
        typedef System::TInterfacedObject inherited;
    private:
        System::StaticArray<TMarshaller::TDisposeRec, 4> FInline;
        System::DynamicArray<TMarshaller::TDisposeRec> FOverflow;
        int FCount;
        void __fastcall AddDispose(const TMarshaller::TDisposeRec &Rec);
        void __fastcall RemoveDispose(const TMarshaller::TDisposeRec &Rec);
        void __fastcall Flush();
    public:
        __fastcall virtual ~TDisposer();
    public:
        /* TObject.Create */ inline __fastcall TDisposer() : System::TInterfacedObject() { }
private:
        void *__TMarshaller_IDisposer;	// TMarshaller::IDisposer
public:
        operator TMarshaller::IDisposer*(void) { return (TMarshaller::IDisposer*)&__TMarshaller_IDisposer; }
    };
#ifndef _WIN64
    #pragma pack(pop)
#endif /* not _WIN64 */
private:
    _di_IDisposer FDisposer;
    void __fastcall AddDispose(const TDisposeRec &Rec);
    template<typename T> static void __fastcall DoUnfixArray(PDisposeRec Rec);
#ifndef _WIN64
    template<typename T> static TDisposeRec __fastcall MakeUnfixArray(System::TPtrWrapper Ptr);
#else /* _WIN64 */
    template<typename T> static TDisposeRec __fastcall MakeUnfixArray(const System::TPtrWrapper &Ptr);
#endif /* _WIN64 */
public:
    System::TPtrWrapper __fastcall InString(TStringBuilder* SB, int MaxLen);
    System::TPtrWrapper __fastcall OutString(const System::UnicodeString S);
    System::TPtrWrapper __fastcall InOutString(TStringBuilder* SB, int MaxLen);
    System::TPtrWrapper __fastcall AsAnsi(const System::UnicodeString S)/* overload */;
    System::TPtrWrapper __fastcall AsAnsi(System::WideChar * S)/* overload */;
    System::TPtrWrapper __fastcall AsAnsi(const System::UnicodeString S, System::Word CodePage)/* overload */;
    System::TPtrWrapper __fastcall AsAnsi(System::WideChar * S, System::Word CodePage)/* overload */;
    System::TPtrWrapper __fastcall AsUtf8(const System::UnicodeString S)/* overload */;
    System::TPtrWrapper __fastcall AsUtf8(System::WideChar * S)/* overload */;
    System::TPtrWrapper __fastcall AsRaw(const TBytes B);
    void __fastcall Flush();
    System::TPtrWrapper __fastcall AllocMem(System::NativeInt Size);
#ifndef _WIN64
    System::TPtrWrapper __fastcall ReallocMem(System::TPtrWrapper OldPtr, System::NativeInt NewSize);
#else /* _WIN64 */
    System::TPtrWrapper __fastcall ReallocMem(const System::TPtrWrapper &OldPtr, System::NativeInt NewSize);
#endif /* _WIN64 */
    template<typename T> System::TPtrWrapper __fastcall FixArray(System::DynamicArray<T> Arr);
    System::TPtrWrapper __fastcall FixString(System::UnicodeString &Str);
    System::TPtrWrapper __fastcall UnsafeFixString(const System::UnicodeString Str);
    System::TPtrWrapper __fastcall AllocStringAsAnsi(const System::UnicodeString Str)/* overload */;
    System::TPtrWrapper __fastcall AllocStringAsAnsi(const System::UnicodeString Str, System::Word CodePage)/* overload */;
    System::TPtrWrapper __fastcall AllocStringAsUtf8(const System::UnicodeString Str)/* overload */;
    System::TPtrWrapper __fastcall AllocStringAsUnicode(const System::UnicodeString Str);
};

Eigenschaften

Typ Sichtbarkeit Quelle Unit Übergeordnet
record
struct
public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Beschreibung

TMarshaller ist ein Record zur Vereinfachung der Arbeit mit Speicherpuffern.

TMarshaller ist eine High-Level-API für das Marshalling von Argumenten. TMarshaller gibt sich selbst und anschließend alle Puffer frei, die für das Kopieren von Argumenten zugewiesen waren.

TMarshaller führt viele Funktionen und Prozeduren für folgende Zwecke ein:

  • Zuweisen von Speicherpuffern.
  • Freigeben von Speicherpuffern.
  • Zugreifen auf Strings mit gekapselten Zeigern.

Siehe auch