Elaztek Developer Hub
Blamite Game Engine - Guerilla (Library)  00382.05.09.23.1235.blamite
The tag editor for the Blamite Game Engine.
block.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <string>
5 
6 #include "../fields.h"
7 
8 #ifdef GUERILLA_LIB_EXPORTS
9 #define GUERILLA_LIB_API __declspec(dllexport)
10 #else
11 #define GUERILLA_LIB_API __declspec(dllimport)
12 #endif
13 
18 {
19 public:
20  std::string name;
21  std::vector<BlamTagField*> fields;
22 
24 
25  BlamTagField* GetField(std::string field_id);
26 
27  BlamTagField* GetField(std::string field_id, BlamTagFieldType field_type);
28 
29  BlamTagBlockEntry* Copy();
30 };
31 
42 {
43 public:
44  int entry_size = 0;
45  std::vector<BlamPluginField*> fields;
46 
47  int c_entry_count = 0;
48  int c_entry_offset = 0;
49 
56 
58 
59  BlamPluginField* GetField(std::string id);
60 
61  BlamPluginField* GetField(std::string id, BlamTagFieldType type);
62 
63  void UpdateOffsetData(int new_offset) override;
64 
65  std::string GenerateXMLString() override;
66 };
67 
78 {
79 public:
80  std::vector<BlamTagBlockEntry*> entries;
81 
88 
89  bool AddEntry(int offset = -1);
90  bool DuplicateEntry(int index);
91  bool DeleteEntry(int index);
92  void DeleteAllEntries();
93 
94  BlamTagBlockEntry* CreateNewEntry();
95 
96  std::string GenerateXMLString();
97  std::string GenerateXMLString(bool keep_unused, bool keep_invalid);
98  std::vector<char> GetValueAsBytes();
99 
105  std::vector<char> GetEntryDataAsBytes();
106 };
BlamTagField
Class representing a tag field.
Definition: fields.h:164
BlamPluginField::GenerateXMLString
virtual std::string GenerateXMLString()
Generates a string representing this plugin field.
Definition: BlamPluginField.cpp:351
BlamTagField_Block::entries
std::vector< BlamTagBlockEntry * > entries
The list of entries within this block.
Definition: block.h:80
BlamTagBlockEntry
Data structure representing a tag block entry.
Definition: block.h:17
BlamTagFieldType
BlamTagFieldType
Enumerator containing all possible tag field types.
Definition: fields.h:23
BlamPluginField_Block
Class representing a block plugin field.
Definition: block.h:41
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
BlamPluginField::UpdateOffsetData
virtual void UpdateOffsetData(int new_offset)
Updates any offsets or lengths for the given field.
Definition: BlamPluginField.cpp:360
BlamTagField_Block
Class representing a block tag field.
Definition: block.h:77
BlamPluginField
Class representing a plugin field.
Definition: fields.h:59
BlamTag
Class representing a Tag.
Definition: tags.h:210
GUERILLA_LIB_API
#define GUERILLA_LIB_API
Definition: block.h:11
BlamTagBlockEntry::fields
std::vector< BlamTagField * > fields
The list of fields within the entry.
Definition: block.h:21
BlamPluginField_Block::fields
std::vector< BlamPluginField * > fields
The list of fields within the tag block.
Definition: block.h:45
BlamTagBlockEntry::name
std::string name
The name of the entry.
Definition: block.h:20
BlamTagField::GetValueAsBytes
virtual std::vector< char > GetValueAsBytes()
Retrieves the field value as a list of bytes.
Definition: BlamTagField.cpp:14