Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
placeholders.h
Go to the documentation of this file.
1 #pragma once
2 
3 //external includes
4 #include <string>
5 
6 #define PLACEHOLDERS_FILE_NAME "placeholders.xml"
7 
8 #ifndef BLAM
9 #define BLAM
10 #endif
11 
29 {
33  struct Placeholder
34  {
35  std::string id = "";
36  std::string value_raw = "";
37  std::string value_parsed = "";
38  bool reserved = false;
39  bool parse_env_var = false;
40  };
41 
49  BLAM int LoadPlaceholders();
50 
56  BLAM int GetCount();
57 
64  BLAM Placeholder GetAt(int i);
65 
72  BLAM std::string ApplyPlaceholders(std::string string);
73 }
BlamVersionStringDisplayMode::Default
@ Default
Indicates the build string should use the default format.
Blam::Settings::Config::GetEngineConfiguration
BLAM BlamConfigurationFile * GetEngineConfiguration()
Retrieves the main engine configuration file.
Definition: config.cpp:58
Blam::Placeholders::Placeholder::id
std::string id
The ID of the placeholder.
Definition: placeholders.h:35
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
Blam::Placeholders::Placeholder::value_parsed
std::string value_parsed
The value of the placeholder after having environment variables expanded.
Definition: placeholders.h:37
Blam::Placeholders::Placeholder::reserved
bool reserved
Whether or not the placeholder's value is reserved and unmodifiable.
Definition: placeholders.h:38
BLAM
#define BLAM
Definition: placeholders.h:9
Blam::Placeholders::Placeholder::parse_env_var
bool parse_env_var
Whether or not to parse environment variables from the placeholder.
Definition: placeholders.h:39
logger.h
BlamVersionStringDisplayMode::TextLog
@ TextLog
Indicates the build string should be formatted for plain text log files.
Blam::Placeholders::ApplyPlaceholders
BLAM std::string ApplyPlaceholders(std::string string)
Replaces any and all placeholder tags in the specified string with their evaulated values.
Definition: placeholders.cpp:21
Blam::Placeholders
Namespace containing things related to the Placeholders system.
Definition: placeholders.h:28
Blam::Placeholders::GetAt
BLAM Placeholder GetAt(int i)
Retrieves the placeholder at the specified index.
Definition: placeholders.cpp:42
PLACEHOLDERS_FILE_NAME
#define PLACEHOLDERS_FILE_NAME
The file to read placeholder information from.
Definition: placeholders.h:6
BlamVersionStringDisplayMode::Console
@ Console
Indicates the build string should be formatted for the in-game console.
Blam::EngineDefs::GetCacheDirectory
const BLAM char * GetCacheDirectory()
Retrieves the directory from which to load game levels.
Definition: engine_definitions.cpp:186
Blam::Placeholders::LoadPlaceholders
BLAM int LoadPlaceholders()
Load placeholder data from placeholders.xml.
Definition: placeholders.cpp:66
Blam::EngineDefs::GetBinkDirectory
const BLAM char * GetBinkDirectory()
Retrieves the directory to read movies from.
Definition: engine_definitions.cpp:191
Blam::EngineDefs::GetVersionBuildString
BLAM std::string GetVersionBuildString(BlamVersionStringDisplayMode display_mode)
Retrieves the build string of the engine.
Definition: engine_definitions.cpp:53
Blam::EngineDefs::GetPlatform
const BLAM char * GetPlatform()
Retrieves the target platform of the engine.
Definition: engine_definitions.cpp:180
Blam::Placeholders::Placeholder
Structure to contain Placeholder data.
Definition: placeholders.h:33
ENGINE_CFG
#define ENGINE_CFG
Macro to allow quicker access to the main configuration file.
Definition: config.h:20
Blam::EngineDefs::GameAffiliates
const BLAM char * GameAffiliates()
Retrieves the game affiliates string.
Definition: engine_definitions.cpp:257
Blam::EngineDefs::GetVersion
const BLAM char * GetVersion()
Retrieves the version of the engine in the following format:
Definition: engine_definitions.cpp:150
Blam::EngineDefs::GetBuildDateTime
BLAM std::string GetBuildDateTime()
Retrieves the build date and time of the engine, pulled directly from the __DATE__ and __TIME__ macro...
Definition: engine_definitions.cpp:170
resource.h
BlamVersionStringDisplayMode::CrashScreen
@ CrashScreen
Indicates the build string should be formatted for the crash screen.
AddReservedPlaceholder
void AddReservedPlaceholder(std::string id, std::string value)
Adds a reserved placeholder to the placeholder list.
Definition: placeholders.cpp:53
Blam::EngineDefs::GameDeveloper
const BLAM char * GameDeveloper()
Retrieves the game developer.
Definition: engine_definitions.cpp:252
Blam::Settings::Config::ExpandAllPlaceholders
BLAM void ExpandAllPlaceholders()
Expands placeholders within all loaded configuration files.
Definition: config.cpp:106
Blam::EngineDefs::GetProductID
const BLAM char * GetProductID()
Retrieves the product ID of the engine.
Definition: engine_definitions.cpp:155
engine_definitions.h
Blam::Placeholders::GetCount
BLAM int GetCount()
Retrieves the amount of placeholders loaded.
Definition: placeholders.cpp:37
value
Offset font vertically by altering the io Font DisplayOffset value
Definition: README.txt:67
config.h
placeholders.h
placeholders
std::vector< Blam::Placeholders::Placeholder > placeholders
The list of loaded placeholders.
Definition: placeholders.cpp:19
Blam::EngineDefs::GetBuildDate
const BLAM char * GetBuildDate()
Retrieves the build date of the engine, pulled directly from the __DATE__ macro.
Definition: engine_definitions.cpp:160
Blam::EngineDefs::GameTitle
const BLAM char * GameTitle()
Retrieves the game title.
Definition: engine_definitions.cpp:242
Blam::EngineDefs::GameCopyright
const BLAM char * GameCopyright()
Retrieves the game copyright string.
Definition: engine_definitions.cpp:262
Blam::EngineDefs::GetReleaseType
const BLAM char * GetReleaseType()
Retrieves the release type of the engine.
Definition: engine_definitions.cpp:196
Blam::Placeholders::Placeholder::value_raw
std::string value_raw
The raw value of the placeholder.
Definition: placeholders.h:36
Blam::EngineDefs::GamePublisher
const BLAM char * GamePublisher()
Retrieves the game publisher.
Definition: engine_definitions.cpp:247