summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/io/binding/_file.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-26 09:09:02 +0800
committerchai <chaifix@163.com>2019-03-26 09:09:02 +0800
commitd9041d6e12ded456c17622f7f2e7bbacb9e99b1a (patch)
tree6fd4febeb79b9b5efb5341ea352e05cd7752f5e8 /source/libs/asura-lib-utils/io/binding/_file.cpp
parent70f8aa8d1a3c15bd1eee3cdd88b9b9ce8970fae5 (diff)
*misc
Diffstat (limited to 'source/libs/asura-lib-utils/io/binding/_file.cpp')
-rw-r--r--source/libs/asura-lib-utils/io/binding/_file.cpp50
1 files changed, 35 insertions, 15 deletions
diff --git a/source/libs/asura-lib-utils/io/binding/_file.cpp b/source/libs/asura-lib-utils/io/binding/_file.cpp
index 5c4c628..0baffd5 100644
--- a/source/libs/asura-lib-utils/io/binding/_file.cpp
+++ b/source/libs/asura-lib-utils/io/binding/_file.cpp
@@ -8,21 +8,23 @@ namespace AsuraEngine
LUAX_REGISTRY(File)
{
LUAX_REGISTER_METHODS(state,
- { "New", _New },
- { "Open", _Open },
- { "Close", _Close },
- { "IsOpen", _IsOpen },
- { "GetMode", _GetMode },
- { "GetSize", _GetSize },
- { "Read", _Read },
- { "IsEOF", _IsEOF },
- { "Write", _Write },
- { "Flush", _Flush },
- { "Tell", _Tell },
- { "Seek", _Seek },
- { "SetBuffer", _SetBuffer },
- { "GetBuffer", _GetBuffer },
- { "GetFileName", _GetFileName }
+ { "New", _New },
+ { "Open", _Open },
+ { "Close", _Close },
+ { "IsOpen", _IsOpen },
+ { "GetMode", _GetMode },
+ { "GetSize", _GetSize },
+ { "Read", _Read },
+ { "IsEOF", _IsEOF },
+ { "Write", _Write },
+ { "Flush", _Flush },
+ { "Tell", _Tell },
+ { "Seek", _Seek },
+ { "SetBuffer", _SetBuffer },
+ { "GetBuffer", _GetBuffer },
+ { "GetFileName", _GetFileName },
+ { "GetExtension", _GetExtension },
+ { "GetName", _GetName }
);
}
@@ -199,5 +201,23 @@ namespace AsuraEngine
return 1;
}
+ // name = file:GetExtension()
+ LUAX_IMPL_METHOD(File, _GetExtension)
+ {
+ LUAX_PREPARE(L, File);
+
+ state.Push(self->GetExtension());
+ return 1;
+ }
+
+ // name = file:GetName()
+ LUAX_IMPL_METHOD(File, _GetName)
+ {
+ LUAX_PREPARE(L, File);
+
+ state.Push(self->GetName());
+ return 1;
+ }
+
}
} \ No newline at end of file