Blamite Game Engine - blam!  00263.10.17.20.0001.blamite
The core library for the Blamite Game Engine.
io.h
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
3 #include <Windows.h>
4 
5 #ifndef BLAM
6 #define BLAM
7 #endif
8 
9 namespace Blam
10 {
11  namespace Utils
12  {
16  namespace IO
17  {
25  BLAM bool FileExists(std::string name);
26 
37  BLAM int CreateNewFile(std::string filename, std::string file_contents);
38 
51  BLAM int CreateFileFromResource(std::string filename, int res_id, const char* res_type, bool apply_placeholders);
52 
64  BLAM int CreateFileFromHTMLResource(std::string filename, int res_id, bool apply_placeholders);
65 
74  BLAM int CreateFileFromPNGResource(std::string filename, int res_id);
75 
84  BLAM void ValidatePath(std::string path);
85 
89  BLAM void OpenGameDirectory();
90 
96  BLAM std::string GetApplicationDir();
97 
107  BLAM bool ReadBinaryFile(std::string path, void* data, int64_t* size);
108 
117  BLAM std::vector<std::string> GetFileContentsAsLines(std::string path);
118  }
119  }
120 }
Blam
Namespace surrounding all major engine components.
Definition: blam_api.h:17
Blam::Utils::IO::GetApplicationDir
BLAM std::string GetApplicationDir()
Retrieves the application's working directory.
Definition: io.cpp:129
Blam::Utils::IO::ValidatePath
BLAM void ValidatePath(std::string path)
Validates that the specified path exists.
Definition: io.cpp:106
Blam::Utils::IO::OpenGameDirectory
BLAM void OpenGameDirectory()
Opens the engine's game directory in Windows Explorer.
Definition: io.cpp:122
Blam::Utils::IO::ReadBinaryFile
BLAM bool ReadBinaryFile(std::string path, void *data, int64_t *size)
Reads a file as raw binary data.
Definition: io.cpp:152
Blam::Utils::IO::CreateFileFromHTMLResource
BLAM int CreateFileFromHTMLResource(std::string filename, int res_id, bool apply_placeholders)
Creates a file with the contents pulled from the specified application HTML resource.
Definition: io.cpp:65
Blam::Utils::IO::FileExists
BLAM bool FileExists(std::string name)
Checks if the specified file exists.
Definition: io.cpp:12
Blam::Utils::IO::CreateFileFromResource
BLAM int CreateFileFromResource(std::string filename, int res_id, const char *res_type, bool apply_placeholders)
Creates a file with the contents pulled from the specified application resource.
Definition: io.cpp:39
BLAM
#define BLAM
Definition: discord_rpc.h:8
Blam::Utils::IO::CreateNewFile
BLAM int CreateNewFile(std::string filename, std::string file_contents)
Creates a file with the specified contents.
Definition: io.cpp:28
Blam::Utils::IO::GetFileContentsAsLines
BLAM std::vector< std::string > GetFileContentsAsLines(std::string path)
Reads a file as a list of strings.
Definition: io.cpp:136
Blam::Utils::IO::CreateFileFromPNGResource
BLAM int CreateFileFromPNGResource(std::string filename, int res_id)
Creates a file with the contents pulled from the specified application PNG resource.
Definition: io.cpp:83