Elaztek Developer Hub
Blamite Game Engine - Guerilla (Library)  00402.09.29.23.0627.blamite
The tag editor for the Blamite Game Engine.
dataref.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../fields.h"
4 
5 #ifdef GUERILLA_LIB_EXPORTS
6 #define GUERILLA_LIB_API __declspec(dllexport)
7 #else
8 #define GUERILLA_LIB_API __declspec(dllimport)
9 #endif
10 
18 {
19 public:
26 
28 
29  std::string GenerateXMLString() override;
30  std::string GenerateCppStructString(std::string line_prefix = "", bool generate_doxygen_comments = true) override;
31  std::string GenerateCppClassString(std::string line_prefix = "") override;
32  BlamTagField* GenerateTagField(BlamTag* tag, void* address) override;
33  BlamTagField* GenerateTagField(BlamTag* tag) override;
34  bool ParseXMLData(rapidxml::xml_node<>* field_node) override;
35 };
36 
44 {
45 public:
46  void* data_address = nullptr;
47  int data_size = 0;
48 
55 
62 
63  std::string GenerateXMLString() override;
64  std::vector<char> GetValueAsBytes() override;
65 
71  std::vector<char> GetReferencedDataAsBytes();
72 };
BlamTagField
Class representing a tag field.
Definition: fields.h:231
GUERILLA_LIB_API
#define GUERILLA_LIB_API
Definition: dataref.h:8
BlamPluginField::GenerateTagField
virtual BlamTagField * GenerateTagField(BlamTag *tag)
Generates a new tag field from this plugin field.
Definition: BlamPluginField.cpp:41
BlamDatarefValueHintType
BlamDatarefValueHintType
Enumerator listing all supported dataref value hint types.
Definition: fields.h:30
BlamTagField_Dataref::BlamTagField_Dataref
BlamTagField_Dataref(BlamTag *_tag)
Constructs a new dataref tag field.
Definition: BlamTagField_Dataref.cpp:8
BlamTagField_Dataref::GetReferencedDataAsBytes
std::vector< char > GetReferencedDataAsBytes()
Compiles the referenced data into a list of bytes.
Definition: BlamTagField_Dataref.cpp:69
tags.h
Guerilla::Tags::Fields::GetDatarefValueHintString
GUERILLA_LIB_API std::string GetDatarefValueHintString(BlamDatarefValueHintType value_hint)
Generates a string from a given dataref value hint type.
Definition: fields.cpp:326
BlamPluginField::GenerateXMLString
virtual std::string GenerateXMLString()
Generates a string representing this plugin field.
Definition: BlamPluginField.cpp:61
BlamTagField_Dataref::value_hint
BlamDatarefValueHintType value_hint
A string that can be checked against to determine the type of data being stored.
Definition: dataref.h:54
BlamTagField::field_id
std::string field_id
The ID of this field.
Definition: fields.h:243
BlamPluginField::GetType
BlamTagFieldType GetType()
Retrieves the type of this field.
Definition: BlamPluginField.cpp:31
BlamPluginField_Dataref::GenerateCppStructString
std::string GenerateCppStructString(std::string line_prefix="", bool generate_doxygen_comments=true) override
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField_Dataref.cpp:39
dataref.h
BlamTagField::GenerateXMLString
virtual std::string GenerateXMLString()
Generates a string with the field ID and value, ready to be written to an XML file.
Definition: BlamTagField.cpp:9
Guerilla::Tags::Fields::GetFieldTypeName
GUERILLA_LIB_API std::string GetFieldTypeName(BlamTagFieldType type)
Generates a string name based on the provided tag field type.
Definition: fields.cpp:235
BlamPluginField::display_name
std::string display_name
The display name of the field.
Definition: fields.h:81
BlamPluginField
Class representing a plugin field.
Definition: fields.h:71
BlamTagField_Dataref
Class representing a dataref tag field.
Definition: dataref.h:43
BlamTag
Class representing a Tag.
Definition: tags.h:277
BlamDatarefValueHintType::NONE
@ NONE
No value hint, no special treatment will be given to the data.
BlamPluginField::visible
bool visible
Whether or not the field is visible.
Definition: fields.h:80
BlamPluginField_Dataref
Class representing a dataref plugin field.
Definition: dataref.h:17
BlamPluginField::ParseXMLData
virtual bool ParseXMLData(rapidxml::xml_node<> *field_node)
Populates data within the plugin field from an XML node.
Definition: BlamPluginField.cpp:106
BlamTagField_Dataref::data_size
int data_size
The size of the referenced data.
Definition: dataref.h:47
BlamPluginField::field_id
std::string field_id
The ID of the field.
Definition: fields.h:83
BlamPluginField_Dataref::BlamPluginField_Dataref
BlamPluginField_Dataref(BlamPluginField *base_field)
Definition: BlamPluginField_Dataref.cpp:8
Guerilla::Tags::Fields::ParseDatarefValueHint
GUERILLA_LIB_API BlamDatarefValueHintType ParseDatarefValueHint(std::string value_hint_str)
Determines a dataref value hint type from a string representation.
Definition: fields.cpp:337
BlamTagField_Dataref::data_address
void * data_address
The address of the referenced data.
Definition: dataref.h:46
BlamPluginField_Dataref::GenerateXMLString
std::string GenerateXMLString() override
Generates a string representing this plugin field.
Definition: BlamPluginField_Dataref.cpp:13
BlamTagField::plugin_field
BlamPluginField * plugin_field
The plugin data associated with this field, if any.
Definition: fields.h:242
BlamPluginField_Dataref::value_hint
BlamDatarefValueHintType value_hint
A string that can be displayed to indicate the type of data expected within a dataref.
Definition: dataref.h:25
BlamPluginField_Dataref::GenerateTagField
BlamTagField * GenerateTagField(BlamTag *tag, void *address) override
Generates a new tag field from this plugin field.
Definition: BlamPluginField_Dataref.cpp:56
BlamPluginField::description
std::string description
An optional description of the field.
Definition: fields.h:82
BlamTagField_Dataref::GenerateXMLString
std::string GenerateXMLString() override
Generates a string with the field ID and value, ready to be written to an XML file.
Definition: BlamTagField_Dataref.cpp:13
BlamPluginField::offset
int offset
The offset of the field data.
Definition: fields.h:78
BlamPluginField_Dataref::ParseXMLData
bool ParseXMLData(rapidxml::xml_node<> *field_node) override
Populates data within the plugin field from an XML node.
Definition: BlamPluginField_Dataref.cpp:97
BlamPluginField::GenerateCppClassString
virtual std::string GenerateCppClassString(std::string line_prefix="")
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField.cpp:101
BlamTagField_Dataref::GetValueAsBytes
std::vector< char > GetValueAsBytes() override
Retrieves the field value as a list of bytes.
Definition: BlamTagField_Dataref.cpp:37
BlamPluginField::GenerateCppStructString
virtual std::string GenerateCppStructString(std::string line_prefix="", bool generate_doxygen_comments=true)
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField.cpp:96
BlamTagField::GetValueAsBytes
virtual std::vector< char > GetValueAsBytes()
Retrieves the field value as a list of bytes.
Definition: BlamTagField.cpp:14
BlamPluginField_Dataref::GenerateCppClassString
std::string GenerateCppClassString(std::string line_prefix="") override
Generates a string containing C++ code representing this plugin field.
Definition: BlamPluginField_Dataref.cpp:51