Elaztek Developer Hub
Blamite Game Engine - Guerilla (Library)  00420.05.12.24.2119.blamite
The tag editor for the Blamite Game Engine.
Guerilla::Tags Namespace Reference

Namespace containing functions relating to tags and plugins. More...

Namespaces

 Compiler
 Namespace containing functions for compiling and decompiling tags.
 
 Fields
 Namespace containing functions relating to tag fields.
 
 Importers
 

Functions

GUERILLA_LIB_API BlamTagLoadTag (std::string file_path)
 Attempts to load a tag from disk and link plugin data. More...
 
GUERILLA_LIB_API BlamTagLoadTag (std::string file_path, BlamTagTreeNode *tree_node)
 Attempts to load a tag from disk and link plugin data. More...
 
GUERILLA_LIB_API BlamTagLoadTag (std::string file_path, BlamTagTreeNode *tree_node, BlamTagUpgradePolicy upgrade_policy)
 Attempts to load a tag from disk and link plugin data. More...
 
GUERILLA_LIB_API bool SaveTag (BlamTag *tag, bool save_both=true)
 Attempts to save a tag back to disk. More...
 
GUERILLA_LIB_API bool SaveTag (BlamTag *tag, bool keep_unused, bool keep_invalid, bool save_both=true)
 Attempts to save a tag back to disk. More...
 
GUERILLA_LIB_API bool SaveTagAs (BlamTag *tag, std::string file_path, bool save_both=true)
 Attempts to save a tag to disk under a new filename. More...
 
GUERILLA_LIB_API bool LinkPluginData (BlamTag *tag)
 Attempts to link all plugin data for a given tag. More...
 
GUERILLA_LIB_API BlamResult LoadPlugins ()
 Loads all available plugins within the default plugin directory '. More...
 
GUERILLA_LIB_API BlamResult LoadPlugins (std::vector< std::string > search_folders)
 Loads all available plugins within the application plugin directory. More...
 
GUERILLA_LIB_API void ReleasePlugins ()
 Releases all plugin data. More...
 
GUERILLA_LIB_API std::vector< BlamPlugin * > GetPluginList ()
 Retrieves the list of loaded plugins. More...
 
GUERILLA_LIB_API BlamPluginGetPlugin (std::string class_name)
 Retrieves a plugin based on its name. More...
 
GUERILLA_LIB_API BlamPluginGetPlugin (std::string class_name, int version)
 Retrieves a plugin based on its name and version. More...
 
GUERILLA_LIB_API BlamPluginGetPluginMatchOrNewer (std::string class_name, int min_version)
 Retrieves a plugin based on its name and version. More...
 
GUERILLA_LIB_API bool PluginExists (std::string class_name)
 Checks whether or not a plugin exists. More...
 
GUERILLA_LIB_API bool PluginExists (std::string class_name, int version)
 Checks whether or not a plugin exists. More...
 
GUERILLA_LIB_API bool PluginExistsMatchOrNewer (std::string class_name, int min_version)
 Checks whether or not a plugin exists. More...
 
GUERILLA_LIB_API bool VerifyPluginCompilationData (BlamPlugin *plugin)
 Performs a series of checks on a plugin to ensure that it is ready to be used for compilation. More...
 
GUERILLA_LIB_API bool VerifyPluginIDs (std::vector< BlamPluginField * > field_list, std::string scope_name)
 Verifies all field IDs within a list of plugin fields. More...
 
GUERILLA_LIB_API bool CheckFieldsExist (std::vector< BlamPluginField * > field_list, BlamMap< std::string, BlamTagFieldType > required_fields, std::string scope_name)
 Scans through a list of plugin fields and ensures that all required fields exist, and that they are of a given type. More...
 

Detailed Description

Namespace containing functions relating to tags and plugins.

Function Documentation

◆ CheckFieldsExist()

bool Guerilla::Tags::CheckFieldsExist ( std::vector< BlamPluginField * >  field_list,
BlamMap< std::string, BlamTagFieldType >  required_fields,
std::string  scope_name 
)

Scans through a list of plugin fields and ensures that all required fields exist, and that they are of a given type.

This can be used in situations such as asset importing or other manual tag creation, in order to ensure that certain fields exist and are of the expected type.

Parameters
field_list- The list of fields to scan through.
required_fields- A map of required field IDs and types to check for.
scope_name- The name of the scope, such as a plugin name or block field ID. Used for debug messages.
Returns
true if all required fields exist. If any field is not found, or has a different type within the field list, then this will return false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPlugin() [1/2]

BlamPlugin * Guerilla::Tags::GetPlugin ( std::string  class_name)

Retrieves a plugin based on its name.

Parameters
class_name- The long or short name of the tag class. Ex: scenario and scnr would both be valid.
Returns
A pointer to the plugin if one was found. If no plugin was found, nullptr is returned.
+ Here is the caller graph for this function:

◆ GetPlugin() [2/2]

BlamPlugin * Guerilla::Tags::GetPlugin ( std::string  class_name,
int  version 
)

Retrieves a plugin based on its name and version.

Will only return a match if both the name AND version are identical.

Parameters
class_name- The long or short name of the tag class. Ex: scenario and scnr would both be valid.
version- The version of the plugin.
Returns
A pointer to the plugin if one was found. If no plugin was found, nullptr is returned.
+ Here is the call graph for this function:

◆ GetPluginList()

std::vector< BlamPlugin * > Guerilla::Tags::GetPluginList ( )

Retrieves the list of loaded plugins.

Returns
The list of loaded plugins.
+ Here is the caller graph for this function:

◆ GetPluginMatchOrNewer()

BlamPlugin * Guerilla::Tags::GetPluginMatchOrNewer ( std::string  class_name,
int  min_version 
)

Retrieves a plugin based on its name and version.

Will only return a match if the name matches, and the version is at equal or greater than the version parameter.

Parameters
class_name- The long or short name of the tag class. Ex: scenario and scnr would both be valid.
min_version- The minimum version of the plugin.
Returns
A pointer to the plugin if one was found. If no plugin was found, nullptr is returned.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LinkPluginData()

bool Guerilla::Tags::LinkPluginData ( BlamTag tag)

Attempts to link all plugin data for a given tag.

Parameters
tag- Pointer to the tag to link plugin data for.
Returns
true if a plugin was found and linked, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadPlugins() [1/2]

BlamResult Guerilla::Tags::LoadPlugins ( )

Loads all available plugins within the default plugin directory '.

/plugins/'.

Returns
BlamResult::Success_OK if all plugins loaded successfully, otherwise returns an error code.

◆ LoadPlugins() [2/2]

BlamResult Guerilla::Tags::LoadPlugins ( std::vector< std::string >  search_folders)

Loads all available plugins within the application plugin directory.

Parameters
search_folders- List of directories to search for plugin files.
Returns
BlamResult::Success_OK if all plugins loaded successfully, otherwise returns an error code.
+ Here is the call graph for this function:

◆ LoadTag() [1/3]

BlamTag * Guerilla::Tags::LoadTag ( std::string  file_path)

Attempts to load a tag from disk and link plugin data.

Parameters
file_path- The path to the tag file on disk.
Returns
Pointer to the newly loaded tag file, or nullptr if the tag could not be loaded.
+ Here is the caller graph for this function:

◆ LoadTag() [2/3]

BlamTag * Guerilla::Tags::LoadTag ( std::string  file_path,
BlamTagTreeNode tree_node 
)

Attempts to load a tag from disk and link plugin data.

Parameters
file_path- The path to the tag file on disk.
tree_node- The tree node to associate with this tag.
Returns
Pointer to the newly loaded tag file, or nullptr if the tag could not be loaded.
+ Here is the call graph for this function:

◆ LoadTag() [3/3]

BlamTag * Guerilla::Tags::LoadTag ( std::string  file_path,
BlamTagTreeNode tree_node,
BlamTagUpgradePolicy  upgrade_policy 
)

Attempts to load a tag from disk and link plugin data.

Parameters
file_path- The path to the tag file on disk.
tree_node- The tree node to associate with this tag.
upgrade_policy- Determines what versioning conditions must be met for the tag to be loaded. See BlamTagUpgradePolicy for details.
Returns
Pointer to the newly loaded tag file, or nullptr if the tag could not be loaded.
+ Here is the call graph for this function:

◆ PluginExists() [1/2]

bool Guerilla::Tags::PluginExists ( std::string  class_name)

Checks whether or not a plugin exists.

Parameters
class_name- The long or short name of the tag class. Ex: scenario and scnr would both be valid.
Returns
true if a matching plugin was found, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PluginExists() [2/2]

bool Guerilla::Tags::PluginExists ( std::string  class_name,
int  version 
)

Checks whether or not a plugin exists.

Parameters
class_name- The long or short name of the tag class. Ex: scenario and scnr would both be valid.
version- The version of the plugin.
Returns
true if a matching plugin was found, otherwise returns false.
+ Here is the call graph for this function:

◆ PluginExistsMatchOrNewer()

bool Guerilla::Tags::PluginExistsMatchOrNewer ( std::string  class_name,
int  min_version 
)

Checks whether or not a plugin exists.

Parameters
class_name- The long or short name of the tag class. Ex: scenario and scnr would both be valid.
min_version- The minimum version of the plugin.
Returns
true if a matching plugin was found, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReleasePlugins()

void Guerilla::Tags::ReleasePlugins ( )

Releases all plugin data.

+ Here is the caller graph for this function:

◆ SaveTag() [1/2]

bool Guerilla::Tags::SaveTag ( BlamTag tag,
bool  keep_unused,
bool  keep_invalid,
bool  save_both = true 
)

Attempts to save a tag back to disk.

Parameters
tag- The tag to save to disk.
keep_unused- Whether or not to preserve unused fields within the tag.
keep_invalid- Whether or not to preserve invalid fields within the tag.
save_both- Whether or not to save both possible tag formats. When enabled, binary (compiled) tags will have their decompiled version saved as a .decompiled file, and decompiled tags will be compiled. Defaults to true.
Returns
true if the tag was successfully saved, otherwise returns false.
+ Here is the call graph for this function:

◆ SaveTag() [2/2]

bool Guerilla::Tags::SaveTag ( BlamTag tag,
bool  save_both = true 
)

Attempts to save a tag back to disk.

Parameters
tag- The tag to save to disk.
save_both- Whether or not to save both possible tag formats. When enabled, binary (compiled) tags will have their decompiled version saved as a .decompiled file, and decompiled tags will be compiled. Defaults to true.
Returns
true if the tag was successfully saved, otherwise returns false.

◆ SaveTagAs()

bool Guerilla::Tags::SaveTagAs ( BlamTag tag,
std::string  file_path,
bool  save_both = true 
)

Attempts to save a tag to disk under a new filename.

Parameters
tag- The tag to save to disk.
file_path- The file path of the new tag.
save_both- Whether or not to save both possible tag formats. When enabled, binary (compiled) tags will have their decompiled version saved as a .decompiled file, and decompiled tags will be compiled. Defaults to true.
Returns
true if the tag was successfully saved, otherwise returns false.
+ Here is the call graph for this function:

◆ VerifyPluginCompilationData()

bool Guerilla::Tags::VerifyPluginCompilationData ( BlamPlugin plugin)

Performs a series of checks on a plugin to ensure that it is ready to be used for compilation.

Parameters
plugin- The plugin to check.
Returns
true if the plugin passed all checks, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VerifyPluginIDs()

bool Guerilla::Tags::VerifyPluginIDs ( std::vector< BlamPluginField * >  field_list,
std::string  scope_name 
)

Verifies all field IDs within a list of plugin fields.

This will also search through any tag blocks and ensure that its children (including other tag blocks) are also valid.

Parameters
field_list- The list of fields to verify.
scope_name- The name of the "scope", used for debug messages. This will usually be the ID of the parent field when searching through a tag block, or "root" when searching through the root of a plugin.
Returns
true if all field IDs are valid, otherwise returns false.
+ Here is the caller graph for this function: