VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vrfConfigurationFileComposer.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 #include <vlutil/vlFilename.h>
13 #include <vlutil/vlHashlist.h>
14 #include <vlutil/vlHashKeys.h>
15 #include <vlutil/vlList.h>
16 #include <vl/hostStructs.h>
17 #include "vrfutil/addressMap.h"
19 #include "vrfutil/scenario.h"
20 #include "vrfutil/backendMap.h"
21 
23 
25 {
26 public:
27 
30 
33 
35  virtual bool init();
36 
38  virtual bool readObjectMap(const DtFilename& objectMap);
39  virtual bool readObjectMapFromZipFile(const DtFilename& scenarioZipFile, const DtFilename& objectMap);
40 
43  virtual std::set<DtSimulationAddress> scenarioBackends() const;
44 
46  virtual DtBackendMap* backendMap();
47 
49  virtual DtAddressMap* objectMap();
50 
53  virtual bool composeOrderOfBattleFile(
54  const DtFilename& targetFileName, const DtList& files, DtString& sError, void* zf = 0);
55 
57  virtual bool saveOrderOfBattleToZipFile(
58  const DtFilename& targetFileName, const DtList& files, DtString& sError, void* zf = 0);
59 
60  virtual bool saveOrderOfBattleToFile(
61  const DtFilename& targetFileName, const DtList& files, DtString& sError);
62 
66  virtual bool composeScenarioScriptsFile(
67  const DtFilename& targetFileName, const DtString& files, void* zf = 0);
68 
71  virtual bool composePlanFile(
72  const DtFilename& targetFileName, const DtList& files, void* zf = 0);
73 
76  virtual bool composeHostilityFile(
77  const DtFilename& targetFileName, const DtList& files, void* zf = 0);
78 
81  virtual bool composeScenarioExtrasFile(
82  const DtFilename& targetFileName, const DtList& files, void* zf = 0);
83 
84 
86  virtual bool createMapFile(
87  const DtFilename& targetFileName,
88  const DtList& simAddresses, const DtList& oobFiles,
89  const DtList& planFiles,
90  bool preserveMappings = true, void* zf = 0);
91 
92  std::vector<DtFilename>& customComponentAttachmentFilenames();
93  const std::vector<DtFilename>& customComponentAttachmentFilenames() const;
102  virtual bool decompose(const DtFilename& orderOfBattle,
103  const DtFilename& plan, const DtFilename& globalPlan, bool& hasGlobalWeatherObject,
104  bool& hasGlobalDynamicTerrainObject);
105  virtual bool decomposeFromZipFile(const DtFilename& scenarioZipFile, const DtFilename& orderOfBattle,
106  const DtFilename& plan, const DtFilename& globalPlan, bool& hasGlobalWeatherObject,
107  bool& hasGlobalDynamicTerrainObject);
108 
111  virtual bool decomposeScenarioScriptsFile(const DtFilename&);
112  virtual bool decomposeScenarioScriptsFromZipFile(const DtFilename& scenarioZipFile, const DtFilename& scriptsFile);
113 
116  virtual bool decomposeComponentAttachmentFile(const DtFilename& originalFile,
117  unsigned numBackends);
119 
120  virtual DtFilename* getOrderOfBattleFile(
121  const DtSimulationAddress& addr) const;
122  virtual DtFilename* getScenarioScriptsFile(const DtSimulationAddress& addr) const;
123  virtual DtFilename* getPlanFile(
124  const DtSimulationAddress& addr) const;
125  virtual DtFilename* getGlobalPlanFile(const DtSimulationAddress& addr) const;
127 
128  virtual const DtFilename& getComponentAttachmentFile(unsigned idx) const;
129 
132  virtual const DtFilename& tempDirectory();
133  virtual void setTempDirectory(const DtFilename& f);
134 
136  virtual void setFilePrefix(const DtString&);
137  virtual const DtString& filePrefix() const;
138 
139 protected:
140  virtual bool storeFileInZipFile(void* zf, const DtFilename& sourceFile, const DtFilename& destFile);
141  virtual bool storeStringInZipFile(void* zf, const DtString&, const DtFilename& target);
142 
143 protected:
144 
145  virtual void clear();
146  virtual bool createBackendFiles(
147  const DtFilename& origFileName,
148  DtHashList& createdFiles, const char* prefix = "(\n",
149  bool* hasGlobalWeatherObject = 0, bool* hasGlobalDynamicTerrainObject = 0);
150  virtual bool createBackendFilesFromZip(const DtFilename& zipFile,
151  const DtFilename& origFileName,
152  DtHashList& createdFiles, const char* prefix = "(\n",
153  bool* hasGlobalWeatherObject = 0, bool* hasGlobalDynamicTerrainObject = 0);
154  virtual bool finalizeBackendFilesParse(const DtFilename& origFileName,
155  DtHashlist& createdFiles, const char* prefix,
156  bool* hasGlobalWeatherObject, bool* hasGlobalDynamicTerrainObject = 0);
157 
160  virtual bool composePlanFileBody(FILE* fp, const DtList& files);
161  virtual bool composePlanFileBody(DtString& fp, const DtList& files);
162 
164  virtual bool fastProcess(const DtFilename& fullname, FILE* fp, DtString* returnBuffer, int& size);
165 
167  virtual bool fastProcessPlanFileBody(const DtFilename& fullname, FILE* fp, DtString* returnBuffer, int& size);
168 
169 protected:
174  DtHashlist myAddr2FileMap;
175  DtHashlist myCreatedPlnFiles;
176  DtHashlist myCreatedOobFiles;
179  std::vector<DtFilename> myCreatedComponentAttachmentFiles;
180  DtFilename myTempDirectory;
184 
188 };
189 
191 {
193 }
194 
195 inline const std::vector<DtFilename>& DtVrfConfigurationFileComposer::customComponentAttachmentFilenames() const
196 {
198 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)