载入中...
搜索中...
未找到
FileData.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <string>
6#include <cstdint>
7#include "common/Data.h"
8#include "common/Exception.h"
9
10namespace eve {
11namespace filesystem {
12
15public:
17 FileData(const std::string &filename, uint64_t size);
19 FileData(const FileData &c);
20
22 virtual ~FileData();
23
25 FileData *clone() const;
27 void * getData() const { return data; }
29 size_t getSize() const { return size; }
30
32 const std::string &getFilename() const { return filename; }
34 const std::string &getExtension() const { return extension; }
36 const std::string &getName() const { return name; }
37
38private:
39 // The actual data.
40 uint8_t *data;
41
42 // Size of the data.
43 uint64_t size;
44
45 // The filename used for error purposes.
46 std::string filename;
47
48 // The extension (without dot). Used to identify file type.
49 std::string extension;
50
51 // The file name without the extension (and without the dot).
52 std::string name;
53
54}; // FileData
55
56} // namespace filesystem
57} // namespace eve
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::int32_t c
std::string name
float size
Definition TreeMesh.cpp:156
Data public API.
Definition Data.h:8
Data buffer paired with a filename (used for type identification).
Definition FileData.h:14
const std::string & getExtension() const
File extension without the leading dot.
Definition FileData.h:34
const std::string & getName() const
Basename without extension.
Definition FileData.h:36
size_t getSize() const
Byte length of the owned buffer.
Definition FileData.h:29
void * getData() const
Pointer to the owned byte buffer.
Definition FileData.h:27
const std::string & getFilename() const
Filename, extension (without dot) and base name.
Definition FileData.h:32
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16