Leviathan  0.8.0.0
Leviathan game engine
ObjectFile.h
Go to the documentation of this file.
1 #pragma once
2 // ------------------------------------ //
3 #include "Define.h"
4 // ------------------------------------ //
7 
8 #include <vector>
9 #include <string>
10 #include <memory>
11 
12 
13 #ifdef LEVIATHAN_USING_ANGELSCRIPT
14 #include "Script/ScriptScript.h"
15 #endif // LEVIATHAN_USING_ANGELSCRIPT
16 
17 namespace Leviathan{
18 
22 public:
23 
24  DLLEXPORT virtual ~ObjectFileList();
25 
28  DLLEXPORT virtual bool AddVariable(std::shared_ptr<NamedVariableList> var) = 0;
29 
30 
32  DLLEXPORT virtual NamedVars& GetVariables() = 0;
33 
35  DLLEXPORT virtual const std::string& GetName() const = 0;
36 
37 
38 protected:
39 
41  };
42 
43 
44 };
45 
46 
50 public:
51 
52  DLLEXPORT ObjectFileListProper(const std::string &name);
53 
54  DLLEXPORT virtual bool AddVariable(std::shared_ptr<NamedVariableList> var);
55 
56  DLLEXPORT virtual NamedVars& GetVariables();
57 
58  DLLEXPORT virtual const std::string& GetName() const;
59 
60 
61 
62 protected:
63 
64  std::string Name;
66 
67 };
68 
72 public:
73 
75 
77  DLLEXPORT virtual void AddTextLine(const std::string &line) = 0;
78 
80  DLLEXPORT virtual size_t GetLineCount() const = 0;
81 
85  DLLEXPORT virtual const std::string& GetLine(size_t index) const = 0;
86 
88  DLLEXPORT virtual const std::string& GetName() const = 0;
89 
90 
91 protected:
92 
94  };
95 };
96 
100 public:
101 
102  DLLEXPORT ObjectFileTextBlockProper(const std::string &name);
104 
105  DLLEXPORT virtual void AddTextLine(const std::string &line);
106 
107  DLLEXPORT virtual size_t GetLineCount() const;
108 
109  DLLEXPORT virtual const std::string& GetLine(size_t index) const;
110 
111  DLLEXPORT virtual const std::string& GetName() const;
112 
113 protected:
114 
115  std::string Name;
116  std::vector<std::string*> Lines;
117 };
118 
119 
124 public:
125 
126  DLLEXPORT virtual ~ObjectFileObject();
127 
129  DLLEXPORT virtual const std::string& GetName() const = 0;
130 
134  DLLEXPORT virtual bool AddVariableList(std::unique_ptr<ObjectFileList>&& list) = 0;
135 
136 
140  DLLEXPORT virtual bool AddTextBlock(std::unique_ptr<ObjectFileTextBlock>&& tblock) = 0;
141 
142 
145  DLLEXPORT virtual void AddScriptScript(std::shared_ptr<ScriptScript> script) = 0;
146 
147 
149  DLLEXPORT virtual const std::string& GetTypeName() const = 0;
150 
151 
154  DLLEXPORT virtual ObjectFileList* GetListWithName(const std::string &name) const = 0;
155 
157  DLLEXPORT virtual size_t GetListCount() const = 0;
158 
161  DLLEXPORT virtual ObjectFileList* GetList(size_t index) const = 0;
162 
163 
166  DLLEXPORT virtual ObjectFileTextBlock* GetTextBlockWithName(const std::string &name)
167  const = 0;
168 
170  DLLEXPORT virtual size_t GetTextBlockCount() const = 0;
171 
174  DLLEXPORT virtual ObjectFileTextBlock* GetTextBlock(size_t index) const = 0;
175 
177  DLLEXPORT virtual std::shared_ptr<ScriptScript> GetScript() const = 0;
178 
179 
181  DLLEXPORT virtual size_t GetPrefixesCount() const = 0;
182 
186  DLLEXPORT virtual const std::string& GetPrefix(size_t index) const = 0;
187 
191  DLLEXPORT virtual bool IsThisTemplated() const = 0;
192 
194  DLLEXPORT virtual std::string Serialize(size_t indentspaces = 0) const = 0;
195 
196 protected:
197 
199  };
200 };
201 
202 
203 
207 public:
208  DLLEXPORT ObjectFileObjectProper(const std::string &name, const std::string &typesname,
209  std::vector<std::unique_ptr<std::string>>&& prefix);
210 
212 
213  DLLEXPORT const std::string& GetName() const override;
214 
215  DLLEXPORT bool AddVariableList(std::unique_ptr<ObjectFileList>&& list) override;
216 
217  DLLEXPORT bool AddTextBlock(std::unique_ptr<ObjectFileTextBlock>&& tblock) override;
218 
219  DLLEXPORT void AddScriptScript(std::shared_ptr<ScriptScript> script) override;
220 
221  DLLEXPORT const std::string& GetTypeName() const override;
222 
223  DLLEXPORT ObjectFileList* GetListWithName(const std::string &name) const override;
224 
225  DLLEXPORT ObjectFileTextBlock* GetTextBlockWithName(const std::string &name) const override;
226 
227  DLLEXPORT std::shared_ptr<ScriptScript> GetScript() const override;
228 
229  DLLEXPORT size_t GetPrefixesCount() const override;
230 
231  DLLEXPORT const std::string& GetPrefix(size_t index) const override;
232  DLLEXPORT const std::string* GetPrefixPtr(size_t index) const;
233  DLLEXPORT bool IsThisTemplated() const override;
234 
235  DLLEXPORT size_t GetListCount() const override;
236 
237  DLLEXPORT ObjectFileList* GetList(size_t index) const override;
238 
239  DLLEXPORT size_t GetTextBlockCount() const override;
240 
241  DLLEXPORT ObjectFileTextBlock* GetTextBlock(size_t index) const override;
242 
243  DLLEXPORT std::string Serialize(size_t indentspaces = 0) const override;
244 
245 
246 protected:
247 
248  std::string Name;
249  std::string TName;
250 
251  std::vector<std::unique_ptr<std::string>> Prefixes;
252  std::vector<ObjectFileList*> Contents;
253  std::vector<ObjectFileTextBlock*> TextBlocks;
254 
255  std::shared_ptr<ScriptScript> Script;
256 };
257 
258 
259 
262 public:
263 
266  DLLEXPORT ObjectFileTemplateObject(const std::string &name, const std::string &typesname,
267  std::vector<std::unique_ptr<std::string>>&& prefix);
268 
269 
270 
271  DLLEXPORT virtual bool IsThisTemplated() const {
272 
273  return true;
274  }
275 
276 };
277 
278 
279 
283 public:
284 
285  DLLEXPORT ObjectFileTemplateInstance(const std::string &mastertmplname,
286  std::vector<std::unique_ptr<std::string>> &templateargs);
287 
288 
289  DLLEXPORT inline const std::string& GetNameOfParentTemplate() const {
290 
291  return TemplatesName;
292  }
293 
294  DLLEXPORT std::string Serialize(size_t indentspaces = 0) const;
295 
296 protected:
297 
299  std::string TemplatesName;
300 
302  std::vector<std::unique_ptr<std::string>> Arguments;
303 };
304 
305 
306 
311 public:
312 
316  DLLEXPORT ObjectFileTemplateDefinition(const std::string &name,
317  std::vector<std::unique_ptr<std::string>> &parameters,
318  std::shared_ptr<ObjectFileObject> obj);
319 
321  DLLEXPORT const std::string& GetName() const;
322 
323 
326  DLLEXPORT static std::shared_ptr<ObjectFileTemplateDefinition> CreateFromObject(
327  const std::string &name, std::shared_ptr<ObjectFileObject> obj,
328  std::vector<std::unique_ptr<std::string>> &templateargs);
329 
333  DLLEXPORT std::unique_ptr<ObjectFileTemplateObject> CreateInstanceFromThis(
334  const ObjectFileTemplateInstance &instanceargs, LErrorReporter* reporterror = nullptr);
335 
337  DLLEXPORT std::string Serialize() const;
338 
339 protected:
340 
341  void ReplaceStringWithTemplateArguments(std::string &target,
342  const std::vector<std::unique_ptr<std::string>> &args);
343 
344  std::string ReplaceStringTemplateArguments(const std::string &target,
345  const std::vector<std::unique_ptr<std::string>> &args);
346 
347  // ------------------------------------ //
348 
350  std::string Name;
351 
353  std::vector<std::unique_ptr<std::string>> Parameters;
354 
356  std::shared_ptr<ObjectFileObject> RepresentingObject;
357 };
358 
359 
360 
361 
364 class ObjectFile {
365 public:
367 
370  DLLEXPORT ObjectFile(NamedVars &stealfrom);
371 
373 
374 
377  DLLEXPORT bool AddNamedVariable(std::shared_ptr<NamedVariableList> var);
378 
384  return AddNamedVariable(std::shared_ptr<NamedVariableList>(var));
385  }
386 
390  DLLEXPORT bool AddObject(std::shared_ptr<ObjectFileObject> obj);
391 
392 
394  DLLEXPORT void AddTemplateInstance(std::shared_ptr<ObjectFileTemplateInstance> tiobj);
395 
398  DLLEXPORT bool AddTemplate(std::shared_ptr<ObjectFileTemplateDefinition> templatedef);
399 
400 
405  return AddObject(std::shared_ptr<ObjectFileObject>(obj));
406  }
407 
408 
412 
414  DLLEXPORT inline size_t GetTotalObjectCount() const {
415  // Add the template objects to actual objects //
416  return DefinedObjects.size();
417  }
418 
422  DLLEXPORT ObjectFileObject* GetObjectFromIndex(size_t index) const;
423 
427  DLLEXPORT ObjectFileObject* GetObjectWithType(const std::string &typestr) const;
428 
430  DLLEXPORT std::vector<ObjectFileObject*> GetAllObjectsWithType(const std::string &type) const;
431 
434  DLLEXPORT bool IsObjectNameInUse(const std::string &name) const;
435 
436 
440 
441 
445  DLLEXPORT std::shared_ptr<ObjectFileTemplateDefinition> FindTemplateDefinition(
446  const std::string &name) const;
447 
449  DLLEXPORT inline size_t GetTemplateDefinitionCount() const {
450 
451  return TemplateDefinitions.size();
452  }
453 
455  DLLEXPORT inline std::shared_ptr<ObjectFileTemplateDefinition> GetTemplateDefinition(size_t index) {
456 
457  if (index >= TemplateDefinitions.size())
458  return nullptr;
459 
460  return TemplateDefinitions[index];
461  }
462 
464  DLLEXPORT inline std::shared_ptr<ObjectFileObject> GetObject(size_t index) {
465 
466  if (index >= DefinedObjects.size())
467  return nullptr;
468 
469  return DefinedObjects[index];
470  }
471 
474 
475  return TemplateInstantiations.size();
476  }
477 
479  DLLEXPORT std::shared_ptr<ObjectFileTemplateInstance> GetTemplateInstance(size_t index) {
480 
481  if (index >= TemplateInstantiations.size())
482  return nullptr;
483 
484  return TemplateInstantiations[index];
485  }
486 
487 protected:
488 
490  std::vector<std::shared_ptr<ObjectFileObject>> DefinedObjects;
491 
493  std::vector<std::shared_ptr<ObjectFileTemplateDefinition>> TemplateDefinitions;
494 
495 
497  std::vector<std::shared_ptr<ObjectFileTemplateInstance>> TemplateInstantiations;
498 
499 
502 
503 
504 };
505 
506 }
507 
DLLEXPORT bool IsObjectNameInUse(const std::string &name) const
Checks whether the given name is in use.
Definition: ObjectFile.cpp:55
virtual DLLEXPORT ~ObjectFileList()
Definition: ObjectFile.cpp:229
Interface for object file lists to implement.
Definition: ObjectFile.h:21
DLLEXPORT ObjectFileList * GetList(size_t index) const override
Gets a list from an index ExceptionInvalidArgument when the index is out of bounds.
Definition: ObjectFile.cpp:363
std::vector< std::unique_ptr< std::string > > Arguments
Template arguments.
Definition: ObjectFile.h:302
hosts one or more VariableBlocks keeping only one name for all of them
Definition: NamedVars.h:27
DLLEXPORT size_t GetListCount() const override
Gets the number of lists in this object.
Definition: ObjectFile.cpp:359
virtual DLLEXPORT size_t GetLineCount() const =0
Returns the number of text lines.
DLLEXPORT const std::string * GetPrefixPtr(size_t index) const
Definition: ObjectFile.cpp:279
DLLEXPORT ObjectFileObjectProper(const std::string &name, const std::string &typesname, std::vector< std::unique_ptr< std::string >> &&prefix)
Definition: ObjectFile.cpp:233
DLLEXPORT size_t GetTemplateInstanceCount() const
Definition: ObjectFile.h:473
virtual DLLEXPORT const std::string & GetLine(size_t index) const
Gets a line from index ExceptionInvalidArgument when the index is out of bounds. ...
Definition: ObjectFile.cpp:490
virtual DLLEXPORT bool AddVariableList(std::unique_ptr< ObjectFileList > &&list)=0
Add a variable list to this object.
DLLEXPORT std::shared_ptr< ScriptScript > GetScript() const override
Returns a std::shared_ptr to our script.
Definition: ObjectFile.cpp:257
DLLEXPORT size_t GetPrefixesCount() const override
Gets the number of prefixes.
Definition: ObjectFile.cpp:261
DLLEXPORT ObjectFile()
Definition: ObjectFile.cpp:23
virtual DLLEXPORT bool AddVariable(std::shared_ptr< NamedVariableList > var)
Adds a new variable.
Definition: ObjectFile.cpp:210
virtual DLLEXPORT void AddTextLine(const std::string &line)
Adds an UTF8 encoded line.
Definition: ObjectFile.cpp:503
DLLEXPORT ObjectFileObject * GetObjectFromIndex(size_t index) const
Gets an ObjectFileObject from an index ExceptionInvalidArgument when the index is out of bounds...
Definition: ObjectFile.cpp:74
DLLEXPORT std::vector< ObjectFileObject * > GetAllObjectsWithType(const std::string &type) const
Gets all ObjectFileObjects that have the type.
Definition: ObjectFile.cpp:101
Class that represents a template definition.
Definition: ObjectFile.h:310
DLLEXPORT std::unique_ptr< ObjectFileTemplateObject > CreateInstanceFromThis(const ObjectFileTemplateInstance &instanceargs, LErrorReporter *reporterror=nullptr)
Creates an instance from this template.
Definition: ObjectFile.cpp:557
DLLEXPORT ObjectFileTextBlock * GetTextBlockWithName(const std::string &name) const override
Gets an ObjectFileTextBlock that matches the name.
Definition: ObjectFile.cpp:347
DLLEXPORT ObjectFileTextBlock * GetTextBlock(size_t index) const override
Gets a text block from an index ExceptionInvalidArgument when the index is out of bounds...
Definition: ObjectFile.cpp:381
DLLEXPORT bool AddNamedVariable(std::shared_ptr< NamedVariableList > var)
Adds a NamedVariableList to this file.
virtual DLLEXPORT size_t GetTextBlockCount() const =0
Gets the number of text blocks in this object.
DLLEXPORT FORCE_INLINE bool AddNamedVariable(NamedVariableList *var)
Adds a NamedVariableList to this file.
Definition: ObjectFile.h:383
DLLEXPORT ObjectFileTemplateInstance(const std::string &mastertmplname, std::vector< std::unique_ptr< std::string >> &templateargs)
Definition: ObjectFile.cpp:785
std::string TemplatesName
The name of the master template from which the instances are generated.
Definition: ObjectFile.h:299
std::shared_ptr< ObjectFileObject > RepresentingObject
The object from which the instances are created.
Definition: ObjectFile.h:356
DLLEXPORT ObjectFileListProper(const std::string &name)
Definition: ObjectFile.cpp:201
DLLEXPORT ObjectFileList * GetListWithName(const std::string &name) const override
Gets an ObjectFileList that matches the name.
Definition: ObjectFile.cpp:335
virtual DLLEXPORT size_t GetPrefixesCount() const =0
Gets the number of prefixes.
DLLEXPORT bool AddTextBlock(std::unique_ptr< ObjectFileTextBlock > &&tblock) override
Add a text block to this object.
Definition: ObjectFile.cpp:306
DLLEXPORT std::string Serialize(size_t indentspaces=0) const
Definition: ObjectFile.cpp:790
Implementation of ObjectFileList.
Definition: ObjectFile.h:49
Implementation of ObjectFileTextBlock.
Definition: ObjectFile.h:99
virtual DLLEXPORT bool AddVariable(std::shared_ptr< NamedVariableList > var)=0
Adds a new variable.
virtual DLLEXPORT const std::string & GetTypeName() const =0
Gets the name of the type.
virtual DLLEXPORT NamedVars & GetVariables()
Gets a reference to the underlying variables.
Definition: ObjectFile.cpp:225
#define FORCE_INLINE
Definition: Include.h:126
DLLEXPORT bool GenerateTemplatedObjects(LErrorReporter *reporterror)
Instantiates all all templates to actual objects.
Definition: ObjectFile.cpp:114
Interface for object file text blocks to implement.
Definition: ObjectFile.h:71
DLLEXPORT const std::string & GetName() const
Gets the name of this template.
Definition: ObjectFile.cpp:518
static DLLEXPORT std::shared_ptr< ObjectFileTemplateDefinition > CreateFromObject(const std::string &name, std::shared_ptr< ObjectFileObject > obj, std::vector< std::unique_ptr< std::string >> &templateargs)
Creates a ObjectFileTemplateDefinition from an ObjectFileObject and a parameter list.
Definition: ObjectFile.cpp:523
virtual DLLEXPORT const std::string & GetName() const
Gets the name of this list.
Definition: ObjectFile.cpp:206
std::vector< std::string * > Lines
Definition: ObjectFile.h:116
DLLEXPORT ObjectFileTextBlockProper(const std::string &name)
Definition: ObjectFile.cpp:473
virtual DLLEXPORT size_t GetListCount() const =0
Gets the number of lists in this object.
virtual DLLEXPORT size_t GetLineCount() const
Returns the number of text lines.
Definition: ObjectFile.cpp:486
DLLEXPORT std::shared_ptr< ObjectFileObject > GetObject(size_t index)
Definition: ObjectFile.h:464
virtual DLLEXPORT ObjectFileList * GetListWithName(const std::string &name) const =0
Gets an ObjectFileList that matches the name.
DLLEXPORT std::shared_ptr< ObjectFileTemplateInstance > GetTemplateInstance(size_t index)
Definition: ObjectFile.h:479
virtual DLLEXPORT ~ObjectFileObject()
Definition: ObjectFile.cpp:469
virtual DLLEXPORT const std::string & GetLine(size_t index) const =0
Gets a line from index ExceptionInvalidArgument when the index is out of bounds. ...
NamedVars HeaderVars
Holds all the named variables that were in the file.
Definition: ObjectFile.h:501
Fully defined ObjectFileObject.
Definition: ObjectFile.h:206
DLLEXPORT size_t GetTotalObjectCount() const
Gets the total number of objects (objects + template instances)
Definition: ObjectFile.h:414
DLLEXPORT bool IsThisTemplated() const override
Returns true when this is a templated object.
Definition: ObjectFile.cpp:464
DLLEXPORT std::string Serialize(size_t indentspaces=0) const override
Definition: ObjectFile.cpp:395
std::vector< std::unique_ptr< std::string > > Prefixes
Definition: ObjectFile.h:251
DLLEXPORT ObjectFileTemplateObject(const std::string &name, const std::string &typesname, std::vector< std::unique_ptr< std::string >> &&prefix)
Creates an ObjectFileTemplateObject as a wrapper around an ObjectFileObject.
Definition: ObjectFile.cpp:814
DLLEXPORT ObjectFileObject * GetObjectWithType(const std::string &typestr) const
Gets an ObjectFileObject matching the type name.
Definition: ObjectFile.cpp:89
DLLEXPORT bool AddTemplate(std::shared_ptr< ObjectFileTemplateDefinition > templatedef)
Adds a ObjectFileTemplateInstance to this file.
Definition: ObjectFile.cpp:165
DLLEXPORT const std::string & GetPrefix(size_t index) const override
Gets a prefix prom an index ExceptionInvalidArgument when the index is out of bounds.
Definition: ObjectFile.cpp:265
virtual DLLEXPORT bool IsThisTemplated() const
Returns true when this is a templated object.
Definition: ObjectFile.h:271
virtual DLLEXPORT const std::string & GetName() const
Gets the name of this text block.
Definition: ObjectFile.cpp:482
DLLEXPORT const std::string & GetTypeName() const override
Gets the name of the type.
Definition: ObjectFile.cpp:253
virtual DLLEXPORT std::string Serialize(size_t indentspaces=0) const =0
std::vector< std::unique_ptr< std::string > > Parameters
Template parameter definitions.
Definition: ObjectFile.h:353
virtual DLLEXPORT const std::string & GetName() const =0
Gets the name of this object.
virtual DLLEXPORT std::shared_ptr< ScriptScript > GetScript() const =0
Returns a std::shared_ptr to our script.
virtual DLLEXPORT ObjectFileList * GetList(size_t index) const =0
Gets a list from an index ExceptionInvalidArgument when the index is out of bounds.
virtual DLLEXPORT const std::string & GetPrefix(size_t index) const =0
Gets a prefix prom an index ExceptionInvalidArgument when the index is out of bounds.
Class that represents an object created from a template.
Definition: ObjectFile.h:261
Represents a template instantiation.
Definition: ObjectFile.h:281
virtual DLLEXPORT ObjectFileTextBlock * GetTextBlock(size_t index) const =0
Gets a text block from an index ExceptionInvalidArgument when the index is out of bounds...
DLLEXPORT bool AddVariableList(std::unique_ptr< ObjectFileList > &&list) override
Add a variable list to this object.
Definition: ObjectFile.cpp:289
std::string ReplaceStringTemplateArguments(const std::string &target, const std::vector< std::unique_ptr< std::string >> &args)
Definition: ObjectFile.cpp:764
virtual DLLEXPORT NamedVars & GetVariables()=0
Gets a reference to the underlying variables.
DLLEXPORT const std::string & GetNameOfParentTemplate() const
Definition: ObjectFile.h:289
std::vector< ObjectFileList * > Contents
Definition: ObjectFile.h:252
Interface for object file objects to implement.
Definition: ObjectFile.h:122
DLLEXPORT ~ObjectFile()
Definition: ObjectFile.cpp:27
virtual DLLEXPORT void AddTextLine(const std::string &line)=0
Adds an UTF8 encoded line.
DLLEXPORT std::shared_ptr< ObjectFileTemplateDefinition > GetTemplateDefinition(size_t index)
Definition: ObjectFile.h:455
std::string Name
Name of this template.
Definition: ObjectFile.h:350
DLLEXPORT size_t GetTextBlockCount() const override
Gets the number of text blocks in this object.
Definition: ObjectFile.cpp:377
#define DLLEXPORT
Definition: Include.h:115
virtual DLLEXPORT const std::string & GetName() const =0
Gets the name of this list.
DLLEXPORT std::shared_ptr< ObjectFileTemplateDefinition > FindTemplateDefinition(const std::string &name) const
Finds the template definition matching the name.
Definition: ObjectFile.cpp:183
std::vector< std::shared_ptr< ObjectFileTemplateInstance > > TemplateInstantiations
Holds all objects that are template instantiations.
Definition: ObjectFile.h:497
DLLEXPORT NamedVars * GetVariables()
Returns a raw pointer to HeaderVars.
Definition: ObjectFile.cpp:70
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12
DLLEXPORT bool AddObject(std::shared_ptr< ObjectFileObject > obj)
Adds a ObjectFileObject to this file.
virtual DLLEXPORT bool IsThisTemplated() const =0
Returns true when this is a templated object.
DLLEXPORT void AddScriptScript(std::shared_ptr< ScriptScript > script) override
Add a script block to this object.
Definition: ObjectFile.cpp:323
virtual DLLEXPORT ~ObjectFileTextBlock()
Definition: ObjectFile.cpp:508
DLLEXPORT ObjectFileTemplateDefinition(const std::string &name, std::vector< std::unique_ptr< std::string >> &parameters, std::shared_ptr< ObjectFileObject > obj)
Creates a ObjectFileTemplateDefinition.
Definition: ObjectFile.cpp:512
DLLEXPORT void AddTemplateInstance(std::shared_ptr< ObjectFileTemplateInstance > tiobj)
Adds a ObjectFileTemplateInstance to this file.
Definition: ObjectFile.cpp:158
std::vector< ObjectFileTextBlock * > TextBlocks
Definition: ObjectFile.h:253
std::shared_ptr< ScriptScript > Script
Definition: ObjectFile.h:255
virtual DLLEXPORT const std::string & GetName() const =0
Gets the name of this text block.
std::vector< std::shared_ptr< ObjectFileTemplateDefinition > > TemplateDefinitions
Holds all the template definitions.
Definition: ObjectFile.h:493
virtual DLLEXPORT void AddScriptScript(std::shared_ptr< ScriptScript > script)=0
Add a script block to this object.
DLLEXPORT const std::string & GetName() const override
Gets the name of this object.
Definition: ObjectFile.cpp:249
DLLEXPORT FORCE_INLINE bool AddObject(ObjectFileObject *obj)
Adds a ObjectFileObject to this file.
Definition: ObjectFile.h:404
DLLEXPORT std::string Serialize() const
Definition: ObjectFile.cpp:532
std::vector< std::shared_ptr< ObjectFileObject > > DefinedObjects
Holds the defined objects.
Definition: ObjectFile.h:490
virtual DLLEXPORT ObjectFileTextBlock * GetTextBlockWithName(const std::string &name) const =0
Gets an ObjectFileTextBlock that matches the name.
DLLEXPORT size_t GetTemplateDefinitionCount() const
Definition: ObjectFile.h:449
void ReplaceStringWithTemplateArguments(std::string &target, const std::vector< std::unique_ptr< std::string >> &args)
Definition: ObjectFile.cpp:752
virtual DLLEXPORT bool AddTextBlock(std::unique_ptr< ObjectFileTextBlock > &&tblock)=0
Add a text block to this object.