MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / BufferObject

Class BufferObject

source/script_object.h:785–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783//
784
785class BufferObject : public Object
786{
787private:
788 static void *getVTable()
789 {
790 BufferObject sBuffer(0, 0);
791 return *(void **)&sBuffer;
792 }
793
794protected:
795 void *mData;
796 size_t mSize;
797 BufferObject(void *aData = nullptr, size_t aSize = 0) : mData(aData), mSize(aSize) {}
798
799public:
800 void *Data() { return mData; }
801 size_t Size() { return mSize; }
802 ResultType Resize(size_t aNewSize);
803
804 ~BufferObject() { free(mData); }
805
806 enum MemberID
807 {
808 P_Ptr,
809 P_Size,
810 M___New = P_Size,
811 };
812 static ObjectMember sMembers[];
813 static Object *sPrototype;
814 static BufferObject *Create(void *aData = nullptr, size_t aSize = 0);
815 ResultType Invoke(ResultToken &aResultToken, int aID, int aFlags, ExprTokenType *aParam[], int aParamCount);
816
817 static void *sVTable;
818 static bool IsInstanceExact(IObject *aObj) { return *(void **)aObj == sVTable; } // Benchmarked a little faster than aObj->IsOfType(BufferObject::sPrototype);
819};
820
821
822//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected