Elaztek Developer Hub
Blamite Game Engine - Guerilla (Library)  00386.06.16.23.0646.blamite
The tag editor for the Blamite Game Engine.
BlamTag Class Reference

Class representing a Tag. More...

#include <tags.h>

+ Collaboration diagram for BlamTag:

Public Member Functions

 BlamTag (std::string _file_path, BlamTagUpgradePolicy _upgrade_policy)
 Prepares a new tag to be loaded. More...
 
 ~BlamTag ()
 Releases any data used by the tag by calling ReleaseFieldData. More...
 
BlamResult LoadFromDisk ()
 Loads the tag as an XML document from disk. More...
 
void SaveToDisk (std::string _file_path)
 Saves any modifications to the XML tag back to disk. More...
 
void SaveToDisk (std::string _file_path, bool keep_unused, bool keep_broken)
 Saves any modifications to the XML tag back to disk. More...
 
void ReleaseFieldData ()
 Releases all items in fields. More...
 
bool LocatePlugin ()
 Attempts to locate a compatiable plugin for a given tag. More...
 
BlamTagFieldGetField (std::string field_id)
 Locates a tag field with a specific ID. More...
 
BlamTagFieldGetField (std::string field_id, BlamTagFieldType field_type)
 Locates a tag field with a specific ID and type. More...
 
std::string GetTagPath ()
 Generates the tag path, relative to its project. More...
 

Public Attributes

BlamPluginplugin = nullptr
 Pointer to the plugin associated with this tag. More...
 
std::vector< BlamRevisionrevisions = std::vector<BlamRevision>()
 The list of revisions within the tag. More...
 
std::vector< BlamTagField * > fields = std::vector<BlamTagField*>()
 The list of fields within the tag. More...
 
std::string file_path = ""
 The path to the tag file. More...
 
BlamProjectproject = nullptr
 The project that this tag belongs to. More...
 
BlamTagTreeNodetree_node = nullptr
 The tree node within the hierarchy that this tag belongs to. More...
 
int class_version = -1
 The class/plugin version of the tag. More...
 
std::string class_name = ""
 The class name as specified in the tag file. Used in the event a plugin could not be found. More...
 
int fieldset_version = 0
 The fieldset version of the tag. Used when decompiling binary tags. More...
 
std::string engine_version = ""
 The engine version that was used to create the tag. Used when decompiling binary tags. More...
 
BlamTagUpgradePolicy upgrade_policy = BlamTagUpgradePolicy::EXACT_VERSION
 The tag's upgrade policy. More...
 

Detailed Description

Class representing a Tag.

Tags can be in one of two formats:

  • Binary - Binary tags contain the raw tag data, similar to how the data would be stored within a Cache File. They do not store any layout information, and as such cannot be opened or modified without a compatiable plugin.
  • XML - XML tags store the tag data in an XML document, which also contains revision history and the tag structure. This is the default format that should be used during development as it is easier to track tag changes, and is more resilient to tag layout changes.

Constructor & Destructor Documentation

◆ BlamTag()

BlamTag::BlamTag ( std::string  _file_path,
BlamTagUpgradePolicy  _upgrade_policy 
)

Prepares a new tag to be loaded.

Note
This does NOT load the tag from disk. You must call LoadFromDisk or #Decompile in order to load data from disk.
Parameters
_file_path- The path to the tag file.
_upgrade_policy- Determines what versioning conditions must be met for the tag to be loaded. See BlamTagUpgradePolicy for details.
+ Here is the call graph for this function:

◆ ~BlamTag()

BlamTag::~BlamTag ( )

Releases any data used by the tag by calling ReleaseFieldData.

+ Here is the call graph for this function:

Member Function Documentation

◆ GetField() [1/2]

BlamTagField * BlamTag::GetField ( std::string  field_id)

Locates a tag field with a specific ID.

Parameters
field_id- The ID of the field.
Returns
Pointer to the field, or nullptr if no field exists with that ID.
+ Here is the caller graph for this function:

◆ GetField() [2/2]

BlamTagField * BlamTag::GetField ( std::string  field_id,
BlamTagFieldType  field_type 
)

Locates a tag field with a specific ID and type.

The field must have a matching ID and type.

Parameters
field_id- The ID of the field.
field_type- The type of the field.
Returns
Pointer to the field, or nullptr if no field exists with that ID.

◆ GetTagPath()

std::string BlamTag::GetTagPath ( )

Generates the tag path, relative to its project.

This will be the same path that the engine will see in-game.

Returns
The tag path, relative to the project. If the tag does not belong to any project, an empty string is returned.

◆ LoadFromDisk()

BlamResult BlamTag::LoadFromDisk ( )

Loads the tag as an XML document from disk.

Returns
#BlamResult::Success_OK if the tag was loaded successfully, otherwise returns an error code.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LocatePlugin()

bool BlamTag::LocatePlugin ( )

Attempts to locate a compatiable plugin for a given tag.

Returns
true if a plugin was found, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReleaseFieldData()

void BlamTag::ReleaseFieldData ( )

Releases all items in fields.

This will both clear the list and free any memory used by the items within the list. After this is called, any references to the fields within the tag become invalid.

+ Here is the caller graph for this function:

◆ SaveToDisk() [1/2]

void BlamTag::SaveToDisk ( std::string  _file_path)

Saves any modifications to the XML tag back to disk.

Parameters
_file_path- The path to the resulting tag file.
+ Here is the caller graph for this function:

◆ SaveToDisk() [2/2]

void BlamTag::SaveToDisk ( std::string  _file_path,
bool  keep_unused,
bool  keep_broken 
)

Saves any modifications to the XML tag back to disk.

Parameters
_file_path- The path to the resulting tag file.
keep_unused- Whether or not to retain unused fields within the tag file.
keep_broken- Whether or not to retain broken fields within the tag file.
+ Here is the call graph for this function:

Member Data Documentation

◆ class_name

std::string BlamTag::class_name = ""

The class name as specified in the tag file. Used in the event a plugin could not be found.

◆ class_version

int BlamTag::class_version = -1

The class/plugin version of the tag.

◆ engine_version

std::string BlamTag::engine_version = ""

The engine version that was used to create the tag. Used when decompiling binary tags.

◆ fields

std::vector<BlamTagField*> BlamTag::fields = std::vector<BlamTagField*>()

The list of fields within the tag.

◆ fieldset_version

int BlamTag::fieldset_version = 0

The fieldset version of the tag. Used when decompiling binary tags.

◆ file_path

std::string BlamTag::file_path = ""

The path to the tag file.

◆ plugin

BlamPlugin* BlamTag::plugin = nullptr

Pointer to the plugin associated with this tag.

◆ project

BlamProject* BlamTag::project = nullptr

The project that this tag belongs to.

◆ revisions

std::vector<BlamRevision> BlamTag::revisions = std::vector<BlamRevision>()

The list of revisions within the tag.

◆ tree_node

BlamTagTreeNode* BlamTag::tree_node = nullptr

The tree node within the hierarchy that this tag belongs to.

Will be nullptr if the tag was opened outside of the context of a project.

◆ upgrade_policy

The tag's upgrade policy.


The documentation for this class was generated from the following files: