summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/io/file_data.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-25 23:46:59 +0800
committerchai <chaifix@163.com>2019-03-25 23:46:59 +0800
commit03b3b8ae80559745f98ef94569b421adddeb441f (patch)
tree7bf46892fef7453d4c25172333bd4fbddb29ee16 /source/libs/asura-lib-utils/io/file_data.cpp
parent82956beb1fe17e1226327638c8ab22b5f5adfc1d (diff)
*misc
Diffstat (limited to 'source/libs/asura-lib-utils/io/file_data.cpp')
-rw-r--r--source/libs/asura-lib-utils/io/file_data.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/source/libs/asura-lib-utils/io/file_data.cpp b/source/libs/asura-lib-utils/io/file_data.cpp
new file mode 100644
index 0000000..47d9095
--- /dev/null
+++ b/source/libs/asura-lib-utils/io/file_data.cpp
@@ -0,0 +1,57 @@
+#include "file_data.h"
+
+namespace AsuraEngine
+{
+ namespace IO
+ {
+
+ FileData::FileData(const std::string& filename)
+ : mData(nullptr)
+ , mFileName(filename)
+ {
+ size_t dot = filename.rfind('.');
+ if (dot != std::string::npos)
+ {
+ mExtension = filename.substr(dot + 1);
+ mName = filename.substr(0, dot);
+ }
+ else
+ mName = filename;
+ }
+
+ FileData::~FileData()
+ {
+ }
+
+ void FileData::BindData(DataBuffer* buffer)
+ {
+ mData = buffer;
+ }
+
+ const std::string& FileData::GetFileName()
+ {
+ return mFileName;
+ }
+
+ const std::string& FileData::GetExtension()
+ {
+ return mExtension;
+ }
+
+ const std::string& FileData::GetName()
+ {
+ return mName;
+ }
+
+ void FileData::BindData(ASURA_MOVE DataBuffer* buffer)
+ {
+ mData = buffer;
+ }
+
+ DataBuffer* FileData::GetDataBuffer()
+ {
+ return mData;
+ }
+
+ }
+}