Blamite Game Engine - Blam (Core)
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  {
27  BLAM bool file_exists(std::string name);
28 
41  BLAM int CreateFile(std::string filename, std::string file_contents);
42 
55  BLAM int CreateFileFromResource(std::string filename, int res_id, const char* res_type, bool apply_placeholders);
56 
68  BLAM int CreateFileFromHTMLResource(std::string filename, int res_id, bool apply_placeholders);
69 
78  BLAM int CreateFileFromPNGResource(std::string filename, int res_id);
79 
88  BLAM void ValidatePath(std::string path);
89 
93  BLAM void OpenGameDirectory();
94 
100  BLAM std::string GetApplicationDir();
101 
111  BLAM HRESULT GetFileAsBinary(std::string path, void* data, DWORD* size);
112 
121  BLAM std::vector<std::string> GetFileContentsAsLines(std::string path);
122  }
123  }
124 }
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:121
Blam::Utils::IO::ValidatePath
BLAM void ValidatePath(std::string path)
Validates that the specified path exists.
Definition: io.cpp:98
Blam::Utils::IO::GetFileAsBinary
BLAM HRESULT GetFileAsBinary(std::string path, void *data, DWORD *size)
Reads a file as raw binary data.
Definition: io.cpp:144
Blam::Utils::IO::OpenGameDirectory
BLAM void OpenGameDirectory()
Opens the engine's game directory in Windows Explorer.
Definition: io.cpp:114
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:57
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: animation.h:6
Blam::Utils::IO::file_exists
BLAM bool file_exists(std::string name)
Checks if the specified file exists.
Definition: io.cpp:12
Blam::Utils::IO::GetFileContentsAsLines
BLAM std::vector< std::string > GetFileContentsAsLines(std::string path)
Reads a file as a list of strings.
Definition: io.cpp:128
Blam::Utils::IO::CreateFile
BLAM int CreateFile(std::string filename, std::string file_contents)
Creates a file with the specified contents.
Definition: io.cpp:28
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:75