Update AS bindings for AbstractFile and children (#2722)

This commit is contained in:
1vanK 2020-11-04 10:21:03 +03:00 committed by GitHub
parent 9a68d9533d
commit 5f9894ee45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 10 deletions

View File

@ -304,7 +304,7 @@ void ASRegisterGenerated_Members_A(asIScriptEngine* engine)
// virtual unsigned Deserializer::GetChecksum() | File: ../IO/Deserializer.h
engine->RegisterObjectMethod("AbstractFile", "uint GetChecksum()", asMETHODPR(AbstractFile, GetChecksum, (), unsigned), asCALL_THISCALL);
engine->RegisterObjectMethod("AbstractFile", "uint get_checksum()", asMETHODPR(AbstractFile, GetChecksum, (), unsigned), asCALL_THISCALL);
// virtual const String& Deserializer::GetName() const | File: ../IO/Deserializer.h
// const String& AbstractFile::GetName() const override | File: ../IO/AbstractFile.h
engine->RegisterObjectMethod("AbstractFile", "const String& GetName() const", asMETHODPR(AbstractFile, GetName, () const, const String&), asCALL_THISCALL);
engine->RegisterObjectMethod("AbstractFile", "const String& get_name() const", asMETHODPR(AbstractFile, GetName, () const, const String&), asCALL_THISCALL);
// unsigned Deserializer::GetPosition() const | File: ../IO/Deserializer.h
@ -402,6 +402,9 @@ void ASRegisterGenerated_Members_A(asIScriptEngine* engine)
engine->RegisterObjectMethod("AbstractFile", "uint Seek(uint)", asMETHODPR(AbstractFile, Seek, (unsigned), unsigned), asCALL_THISCALL);
// unsigned Deserializer::SeekRelative(int delta) | File: ../IO/Deserializer.h
engine->RegisterObjectMethod("AbstractFile", "uint SeekRelative(int)", asMETHODPR(AbstractFile, SeekRelative, (int), unsigned), asCALL_THISCALL);
// virtual void AbstractFile::SetName(const String& name) | File: ../IO/AbstractFile.h
engine->RegisterObjectMethod("AbstractFile", "void SetName(const String&in)", asMETHODPR(AbstractFile, SetName, (const String&), void), asCALL_THISCALL);
engine->RegisterObjectMethod("AbstractFile", "void set_name(const String&in)", asMETHODPR(AbstractFile, SetName, (const String&), void), asCALL_THISCALL);
// unsigned Deserializer::Tell() const | File: ../IO/Deserializer.h
engine->RegisterObjectMethod("AbstractFile", "uint Tell() const", asMETHODPR(AbstractFile, Tell, () const, unsigned), asCALL_THISCALL);
// virtual unsigned Serializer::Write(const void* data, unsigned size)=0 | File: ../IO/Serializer.h

View File

@ -244,7 +244,7 @@ void ASRegisterGenerated_Members_F(asIScriptEngine* engine)
// FileMode File::GetMode() const | File: ../IO/File.h
engine->RegisterObjectMethod("File", "FileMode GetMode() const", asMETHODPR(File, GetMode, () const, FileMode), asCALL_THISCALL);
engine->RegisterObjectMethod("File", "FileMode get_mode() const", asMETHODPR(File, GetMode, () const, FileMode), asCALL_THISCALL);
// const String& File::GetName() const override | File: ../IO/File.h
// const String& AbstractFile::GetName() const override | File: ../IO/AbstractFile.h
engine->RegisterObjectMethod("File", "const String& GetName() const", asMETHODPR(File, GetName, () const, const String&), asCALL_THISCALL);
engine->RegisterObjectMethod("File", "const String& get_name() const", asMETHODPR(File, GetName, () const, const String&), asCALL_THISCALL);
// unsigned Deserializer::GetPosition() const | File: ../IO/Deserializer.h
@ -398,8 +398,9 @@ void ASRegisterGenerated_Members_F(asIScriptEngine* engine)
// void Object::SetGlobalVar(StringHash key, const Variant& value) | File: ../Core/Object.h
engine->RegisterObjectMethod("File", "void SetGlobalVar(StringHash, const Variant&in)", asMETHODPR(File, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
engine->RegisterObjectMethod("File", "void set_globalVar(StringHash, const Variant&in)", asMETHODPR(File, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
// void File::SetName(const String& name) | File: ../IO/File.h
// virtual void AbstractFile::SetName(const String& name) | File: ../IO/AbstractFile.h
engine->RegisterObjectMethod("File", "void SetName(const String&in)", asMETHODPR(File, SetName, (const String&), void), asCALL_THISCALL);
engine->RegisterObjectMethod("File", "void set_name(const String&in)", asMETHODPR(File, SetName, (const String&), void), asCALL_THISCALL);
// void Object::SubscribeToEvent(StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
// Error: type "EventHandler*" can not automatically bind
// void Object::SubscribeToEvent(Object* sender, StringHash eventType, EventHandler* handler) | File: ../Core/Object.h

View File

@ -39,10 +39,10 @@ static NamedPipe* NamedPipe_NamedPipe_Context()
return new NamedPipe(GetScriptContext());
}
// NamedPipe::NamedPipe(Context* context, const String& pipeName, bool isServer) | File: ../IO/NamedPipe.h
static NamedPipe* NamedPipe_NamedPipe_Context_String_bool(const String &pipeName, bool isServer)
// NamedPipe::NamedPipe(Context* context, const String& name, bool isServer) | File: ../IO/NamedPipe.h
static NamedPipe* NamedPipe_NamedPipe_Context_String_bool(const String &name, bool isServer)
{
return new NamedPipe(GetScriptContext(), pipeName, isServer);
return new NamedPipe(GetScriptContext(), name, isServer);
}
// StringVector Deserializer::ReadStringVector() | File: ../IO/Deserializer.h
@ -297,7 +297,7 @@ void ASRegisterGenerated_Members_N(asIScriptEngine* engine)
// const VariantMap& Object::GetGlobalVars() const | File: ../Core/Object.h
engine->RegisterObjectMethod("NamedPipe", "const VariantMap& GetGlobalVars() const", asMETHODPR(NamedPipe, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
engine->RegisterObjectMethod("NamedPipe", "const VariantMap& get_globalVars() const", asMETHODPR(NamedPipe, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
// const String& NamedPipe::GetName() const override | File: ../IO/NamedPipe.h
// const String& AbstractFile::GetName() const override | File: ../IO/AbstractFile.h
engine->RegisterObjectMethod("NamedPipe", "const String& GetName() const", asMETHODPR(NamedPipe, GetName, () const, const String&), asCALL_THISCALL);
engine->RegisterObjectMethod("NamedPipe", "const String& get_name() const", asMETHODPR(NamedPipe, GetName, () const, const String&), asCALL_THISCALL);
// unsigned Deserializer::GetPosition() const | File: ../IO/Deserializer.h
@ -343,11 +343,11 @@ void ASRegisterGenerated_Members_N(asIScriptEngine* engine)
engine->RegisterObjectMethod("NamedPipe", "bool get_server() const", asMETHODPR(NamedPipe, IsServer, () const, bool), asCALL_THISCALL);
// explicit NamedPipe::NamedPipe(Context* context) | File: ../IO/NamedPipe.h
engine->RegisterObjectBehaviour("NamedPipe", asBEHAVE_FACTORY, "NamedPipe@+ f()", asFUNCTION(NamedPipe_NamedPipe_Context), asCALL_CDECL);
// NamedPipe::NamedPipe(Context* context, const String& pipeName, bool isServer) | File: ../IO/NamedPipe.h
// NamedPipe::NamedPipe(Context* context, const String& name, bool isServer) | File: ../IO/NamedPipe.h
engine->RegisterObjectBehaviour("NamedPipe", asBEHAVE_FACTORY, "NamedPipe@+ f(const String&in, bool)", asFUNCTION(NamedPipe_NamedPipe_Context_String_bool), asCALL_CDECL);
// virtual void Object::OnEvent(Object* sender, StringHash eventType, VariantMap& eventData) | File: ../Core/Object.h
engine->RegisterObjectMethod("NamedPipe", "void OnEvent(Object@+, StringHash, VariantMap&)", asMETHODPR(NamedPipe, OnEvent, (Object*, StringHash, VariantMap&), void), asCALL_THISCALL);
// bool NamedPipe::Open(const String& pipeName, bool isServer) | File: ../IO/NamedPipe.h
// bool NamedPipe::Open(const String& name, bool isServer) | File: ../IO/NamedPipe.h
engine->RegisterObjectMethod("NamedPipe", "bool Open(const String&in, bool)", asMETHODPR(NamedPipe, Open, (const String&, bool), bool), asCALL_THISCALL);
// unsigned NamedPipe::Read(void* dest, unsigned size) override | File: ../IO/NamedPipe.h
// Error: type "void*" can not automatically bind
@ -453,6 +453,9 @@ void ASRegisterGenerated_Members_N(asIScriptEngine* engine)
// void Object::SetGlobalVar(StringHash key, const Variant& value) | File: ../Core/Object.h
engine->RegisterObjectMethod("NamedPipe", "void SetGlobalVar(StringHash, const Variant&in)", asMETHODPR(NamedPipe, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
engine->RegisterObjectMethod("NamedPipe", "void set_globalVar(StringHash, const Variant&in)", asMETHODPR(NamedPipe, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
// void NamedPipe::SetName(const String& name) override | File: ../IO/NamedPipe.h
engine->RegisterObjectMethod("NamedPipe", "void SetName(const String&in)", asMETHODPR(NamedPipe, SetName, (const String&), void), asCALL_THISCALL);
engine->RegisterObjectMethod("NamedPipe", "void set_name(const String&in)", asMETHODPR(NamedPipe, SetName, (const String&), void), asCALL_THISCALL);
// void Object::SubscribeToEvent(StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
// Error: type "EventHandler*" can not automatically bind
// void Object::SubscribeToEvent(Object* sender, StringHash eventType, EventHandler* handler) | File: ../Core/Object.h

View File

@ -1578,7 +1578,7 @@ void ASRegisterGenerated_Members_V(asIScriptEngine* engine)
// Error: type "const unsigned char*" can not automatically bind
// unsigned char* VectorBuffer::GetModifiableData() | File: ../IO/VectorBuffer.h
// Error: type "unsigned char*" can not automatically bind
// virtual const String& Deserializer::GetName() const | File: ../IO/Deserializer.h
// const String& AbstractFile::GetName() const override | File: ../IO/AbstractFile.h
engine->RegisterObjectMethod("VectorBuffer", "const String& GetName() const", asMETHODPR(VectorBuffer, GetName, () const, const String&), asCALL_THISCALL);
engine->RegisterObjectMethod("VectorBuffer", "const String& get_name() const", asMETHODPR(VectorBuffer, GetName, () const, const String&), asCALL_THISCALL);
// unsigned Deserializer::GetPosition() const | File: ../IO/Deserializer.h
@ -1684,6 +1684,9 @@ void ASRegisterGenerated_Members_V(asIScriptEngine* engine)
// Error: type "void*" can not automatically bind
// void VectorBuffer::SetData(Deserializer& source, unsigned size) | File: ../IO/VectorBuffer.h
engine->RegisterObjectMethod("VectorBuffer", "void SetData(Deserializer&, uint)", asMETHODPR(VectorBuffer, SetData, (Deserializer&, unsigned), void), asCALL_THISCALL);
// virtual void AbstractFile::SetName(const String& name) | File: ../IO/AbstractFile.h
engine->RegisterObjectMethod("VectorBuffer", "void SetName(const String&in)", asMETHODPR(VectorBuffer, SetName, (const String&), void), asCALL_THISCALL);
engine->RegisterObjectMethod("VectorBuffer", "void set_name(const String&in)", asMETHODPR(VectorBuffer, SetName, (const String&), void), asCALL_THISCALL);
// unsigned Deserializer::Tell() const | File: ../IO/Deserializer.h
engine->RegisterObjectMethod("VectorBuffer", "uint Tell() const", asMETHODPR(VectorBuffer, Tell, () const, unsigned), asCALL_THISCALL);
// explicit VectorBuffer::VectorBuffer(const PODVector<unsigned char>& data) | File: ../IO/VectorBuffer.h

View File

@ -40,6 +40,7 @@ public:
/// Destruct.
~AbstractFile() override = default;
/// Change the file name. Used by the resource system.
/// @property
virtual void SetName(const String& name) { name_ = name; }
/// Return the file name.
const String& GetName() const override { return name_; }