Elaztek Developer Hub
Blamite Game Engine - blam!  00346.12.11.21.0529.blamite
The core library for the Blamite Game Engine.
config.h File Reference
#include <map>
#include <string>
#include <Windows.h>
#include <Strings/components/settings/config/config.h>
#include "components/resources/engine_globals/globals.h"
#include "components/diagnostics/errors/errors.h"

Go to the source code of this file.

Classes

struct  Blam::Config::ConfigFile
 

Namespaces

 Blam
 Namespace surrounding all major engine components.
 
 Blam::Settings
 
 Blam::Settings::Config
 Namespace for anything related to engine configuration files.
 
 Blam::Settings::Paths
 Namespace containing functions for fetching full paths from configuration files.
 
 Blam::Config
 Namespace for legacy configuration compatiability.
 

Macros

#define CONFIG_VER   "1"
 The current version of the main engine configuration. More...
 
#define CONFIG_COMMENT_DELIMETER   "#"
 The character that indicates a commented-out line. More...
 
#define CONFIG_DEFAULT_NAME   "engine.cfg"
 The filename of the default engine configuration. More...
 
#define CONFIG_COLOR_NAME   "console_colors.cfg"
 The filename of the default console color configuration. More...
 
#define ENGINE_CFG   Blam::Config::GetConfig()
 Macro to allow quicker access to the main configuration file. More...
 
#define ENGINE_CFG_SECTION(section_name)   Blam::Settings::Config::GetEngineConfiguration()->GetConfigurationSection(section_name)
 Macro to quickly access a configuration section from the engine configuration file. More...
 
#define ENGINE_DATA_PATH(path)   Blam::Settings::Paths::GetEngineDataPath(path)
 Macro to quickly access a game engine data folder. More...
 
#define USER_DATA_PATH(path)   Blam::Settings::Paths::GetUserDataPath(path)
 Macro to quickly access a user data folder. More...
 
#define BLAM
 

Enumerations

enum  BlamEngineDataFolder {
  BlamEngineDataFolder::DataRoot, BlamEngineDataFolder::Content, BlamEngineDataFolder::Gallery, BlamEngineDataFolder::Maps,
  BlamEngineDataFolder::Fonts, BlamEngineDataFolder::Tags, BlamEngineDataFolder::Resources, BlamEngineDataFolder::DefaultConfigs
}
 Enumerator listing all possible engine data folders. More...
 
enum  BlamUserDataFolder {
  BlamUserDataFolder::DataRoot, BlamUserDataFolder::Tags, BlamUserDataFolder::Maps, BlamUserDataFolder::Mods,
  BlamUserDataFolder::Plugins, BlamUserDataFolder::Screenshots, BlamUserDataFolder::Reports, BlamUserDataFolder::LogArchives,
  BlamUserDataFolder::Cache
}
 Enumerator listing all possible user data folders. More...
 

Functions

BLAM BlamResult Blam::Settings::Config::LoadEngineConfiguration ()
 
BLAM BlamResult Blam::Settings::Config::LoadConfiguration (std::string filename)
 
BLAM BlamResult Blam::Settings::Config::LoadConfiguration (std::string filename, std::string defaults_filename)
 
BLAM BlamConfigurationFile * Blam::Settings::Config::GetEngineConfiguration ()
 
BLAM BlamConfigurationFile * Blam::Settings::Config::GetConfiguration (std::string filename)
 
BLAM bool Blam::Settings::Config::IsEngineConfigurationAvailable ()
 
BLAM bool Blam::Settings::Config::IsConfigurationAvailable (std::string filename)
 
BLAM void Blam::Settings::Config::ExpandAllPlaceholders ()
 
BLAM void Blam::Settings::Config::ExpandFilePlaceholders (BlamConfigurationFile *file)
 
BLAM std::map< std::string, BlamConfigurationFile * > * Blam::Settings::Config::GetConfigurationFiles ()
 
BLAM std::string Blam::Settings::Paths::GetDefaultEngineDataPath (BlamEngineDataFolder folder)
 Retrieves a default value of a given engine data directory. More...
 
BLAM std::string Blam::Settings::Paths::GetDefaultUserDataPath (BlamUserDataFolder folder)
 Retrieves a default value of a given user data directory. More...
 
BLAM std::string Blam::Settings::Paths::GetEngineDataPath (BlamEngineDataFolder folder)
 Retrieves the configured value of a given engine directory. More...
 
BLAM std::string Blam::Settings::Paths::GetUserDataPath (BlamUserDataFolder folder)
 Retrieves the configured value of a given user directory. More...
 
BLAM BlamUserDataFolder Blam::Settings::Paths::GetUserDataFolderFromString (std::string folder)
 Attempts to convert a string to the equivalent user data folder. More...
 
BLAM BlamEngineDataFolder Blam::Settings::Paths::GetEngineDataFolderFromString (std::string folder)
 Attempts to convert a string to the equivalent engine data folder. More...
 
BLAM ConfigFile * Blam::Config::GetConfig ()
 
BLAM ConfigFile * Blam::Config::GetConfig (std::string filename)
 

Macro Definition Documentation

◆ BLAM

#define BLAM

◆ CONFIG_COLOR_NAME

#define CONFIG_COLOR_NAME   "console_colors.cfg"

The filename of the default console color configuration.

◆ CONFIG_COMMENT_DELIMETER

#define CONFIG_COMMENT_DELIMETER   "#"

The character that indicates a commented-out line.

◆ CONFIG_DEFAULT_NAME

#define CONFIG_DEFAULT_NAME   "engine.cfg"

The filename of the default engine configuration.

◆ CONFIG_VER

#define CONFIG_VER   "1"

The current version of the main engine configuration.

◆ ENGINE_CFG

#define ENGINE_CFG   Blam::Config::GetConfig()

Macro to allow quicker access to the main configuration file.

Deprecated:
Will be removed in the future, only works using legacy configuration system.

◆ ENGINE_CFG_SECTION

#define ENGINE_CFG_SECTION (   section_name)    Blam::Settings::Config::GetEngineConfiguration()->GetConfigurationSection(section_name)

Macro to quickly access a configuration section from the engine configuration file.

Parameters
section_name- The name of the section to retrieve.

◆ ENGINE_DATA_PATH

#define ENGINE_DATA_PATH (   path)    Blam::Settings::Paths::GetEngineDataPath(path)

Macro to quickly access a game engine data folder.

Parameters
path- The engine folder to retrieve.

◆ USER_DATA_PATH

#define USER_DATA_PATH (   path)    Blam::Settings::Paths::GetUserDataPath(path)

Macro to quickly access a user data folder.

Parameters
path- The user folder to retrieve.

Enumeration Type Documentation

◆ BlamEngineDataFolder

enum BlamEngineDataFolder
strong

Enumerator listing all possible engine data folders.

Engine data folders refer to directories which contain built-in game engine files. These are files that the user is generally not advised to alter or modify and should typically only contain stock or 'retail' content.

Files within these directories generally do not change over time, outside of game or engine updates.

Enumerator
DataRoot 

The root of all game engine data. Defaults to ./

Content 

Directory containing general-purpose resources. Defaults to ./content/

Gallery 

Directory containing general-purpose images. Defaults to ./content/Gallery/

Maps 

Directory used for storing built-in cache files. Defaults to ./maps/

Fonts 

Directory used for game engine fonts. Defaults to ./maps/fonts/

Tags 

Directory used for reading engine tags. Defaults to ./tags/

Resources 

Directory containing other resources and data, usually string tables and globals. Defaults to ./data/

DefaultConfigs 

Directory containing default configuration files. Defaults to ./content/blam/default_configs/

◆ BlamUserDataFolder

enum BlamUserDataFolder
strong

Enumerator listing all possible user data folders.

User data folders refer to directories which contain user-generated content. This may include mods, custom cache files, custom tags, screenshots, as well as user configuration files. It also serves as a place to store any sort of routinely-changing content, such as log files or reports.

Files within these folders are generally considered user-modifiable.

You will see {DataRoot} used in the default path details below. This placeholder represents the value represented by DataRoot.

Enumerator
DataRoot 

The root of all user data. Defaults to BlamStrings::Utils::IO::GetEngineDataRoot().

Tags 

Directory storing user-created tags. Defaults to {DataRoot}/tags/.

Maps 

Directory storing user-installed cache files. Defaults to {DataRoot}/maps/.

Mods 

Directory storing user-created mod packages. Defaults to {DataRoot}/mods/.

Plugins 

Directory used to store plugin files for use with the Editing Kit. Defaults to {DataRoot}/plugins/.

Screenshots 

Directory used to store engine screenshots. Defaults to {DataRoot}/screenshots/.

Reports 

Directory used to store the latest report (log) files. Defaults to {DataRoot}/reports/.

LogArchives 

Directory used to store previous log archives. Defaults to {DataRoot}/logs/.

Cache 

Directory used to store any cached data used by the engine (not to be confused with .map cache files). Defaults to {DataRoot}/cache/.