diff options
author | chai <chaifix@163.com> | 2019-03-25 23:46:59 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-25 23:46:59 +0800 |
commit | 03b3b8ae80559745f98ef94569b421adddeb441f (patch) | |
tree | 7bf46892fef7453d4c25172333bd4fbddb29ee16 /source/libs/asura-lib-utils/io/file_data.h | |
parent | 82956beb1fe17e1226327638c8ab22b5f5adfc1d (diff) |
*misc
Diffstat (limited to 'source/libs/asura-lib-utils/io/file_data.h')
-rw-r--r-- | source/libs/asura-lib-utils/io/file_data.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/source/libs/asura-lib-utils/io/file_data.h b/source/libs/asura-lib-utils/io/file_data.h new file mode 100644 index 0000000..e20f41b --- /dev/null +++ b/source/libs/asura-lib-utils/io/file_data.h @@ -0,0 +1,68 @@ +#ifndef __ASURA_ENGINE_FILE_DATA_H__ +#define __ASURA_ENGINE_FILE_DATA_H__ + +#include <string> + +#include <asura-lib-utils/scripting/portable.hpp> + +#include "data_buffer.h" + +namespace AsuraEngine +{ + namespace IO + { + + class Filesystem; + + /// + /// filesystemֱӶȡļʱFileDataļݺϢFilesystem + /// + class FileData ASURA_FINAL + : public AEScripting::Portable<FileData> + { + public: + + LUAX_DECL_FACTORY(FileData); + + /// + /// ļݣͨDatabufferݺʹСڲӿڶData bufferΪҲdata buffer + /// + DataBuffer* GetDataBuffer(); + + const std::string& GetFileName(); + const std::string& GetExtension(); + const std::string& GetName(); + + private: + + friend class Filesystem; + + FileData(const std::string& name); + ~FileData(); + + /// + /// data buffer + /// + void BindData(ASURA_MOVE DataBuffer* buffer); + + /// + /// Data bufferfiledataʱ٣luaüΪ0ʱluaGC١mDataʱһԱá + /// + ASURA_REF DataBuffer* mData; + Luax::LuaxMemberRef mDataRef; + + std::string mFileName; ///< չļ + std::string mExtension; ///< չ + std::string mName; ///< ͺļ + + LUAX_DECL_METHOD(_GetFileName); + LUAX_DECL_METHOD(_GetExtension); + LUAX_DECL_METHOD(_GetName); + LUAX_DECL_METHOD(_GetDataBuffer); + + }; + + } +} + +#endif
\ No newline at end of file |