Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
file.h
Go to the documentation of this file.
1
12#ifndef MINESERVER_FILE_H
13#define MINESERVER_FILE_H
14
15#include <string>
16#include <vector>
17
22class File
23{
24private:
25 std::vector<char> data;
26 std::string path;
27
28public:
36 File();
43 File(std::string path);
48 ~File();
49
56 bool load();
57
66 const std::string &getPath() const;
67
73 const char *getPointer() const;
79 int getSize() const;
80};
81
86class PNGFile : public File
87{
88private:
89 unsigned int width, height;
90 std::string base64String;
91
92public:
100 PNGFile();
109 PNGFile(std::string path);
115
121 unsigned int getWidth() const;
127 unsigned int getHeight() const;
133 const std::string &getBase64String() const;
134};
135
136#endif // MINESERVER_FILE_H
File Loader Wrapper.
Definition file.h:23
bool load()
Loads the data of the file into ram.
Definition file.cpp:31
int getSize() const
Get the size of the file stored.
Definition file.cpp:56
const std::string & getPath() const
Get the Path object.
Definition file.cpp:46
~File()
Destroy the File object.
Definition file.cpp:27
File()
Constructs a new File object.
Definition file.cpp:18
const char * getPointer() const
Get the pointer to the data.
Definition file.cpp:51
Wrapper around File for PNG files.
Definition file.h:87
unsigned int getHeight() const
Get the Height of the file.
Definition file.cpp:103
PNGFile()
Construct a new PNGFile object.
Definition file.cpp:61
unsigned int getWidth() const
Get the Width of the file.
Definition file.cpp:98
const std::string & getBase64String() const
Get the Base64 representation of the file.
Definition file.cpp:108
~PNGFile()
Destroy the PNGFile object.