VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xmlFedReader.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #pragma once
7 
11 
12 #include <stdio.h>
13 #include <string>
14 
15 #include "fedReader.h"
16 
17 #include <vlutil/vlString.h>
18 #include <vlutil/vlFilename.h>
19 #include <vlutil/vlFedTarget.h>
20 
21 //
22 //
23 // //! Forward declarations
24 // struct _xmlNode;
25 // struct _xmlDoc;
26 // typedef unsigned char xmlChar;
27 // typedef struct _xmlNode xmlNode;
28 // typedef struct _xmlDoc xmlDoc;
29 
30 #ifdef DtUSE_UTILITIES_NAMESPACE
31 namespace DtUSE_UTILITIES_NAMESPACE
32 {
33 #endif
34 
39 {
40 public:
41 
44 
46  virtual ~DtXmlFedReader();
47 
48 private:
49 
52  DtXmlFedReader& operator=( const DtXmlFedReader& );
53 
54 public:
55 
58  virtual DtFedReadStatus readFedFilePtr(FILE* filePointer, DtFedTarget *fedTarget, DtFilename fileName,
59  unsigned int strictCheckingMask=DtFedReadStrictDisabled, bool useDTD=false, bool dontParseSwitches=false ) = 0;
60 
61 public:
62 
64 
65  static DtFomType fomType(void* fedFilePtr);
66  static DtFomType fomType(xmlNode* rootNode);
68 
70  static xmlNode* getNodeByName(xmlNode* currentNode, const xmlChar* nodeName);
71 
73  static const xmlChar* childContentByName(xmlNode* node, const xmlChar *name);
74 
75 protected:
76 
78  virtual DtFedReadStatus processFed(xmlNode* fedObj) = 0;
79 
81  virtual DtFedReadStatus parseTransportationsList(xmlNode* currentNode) = 0;
82 
84  virtual DtFedReadStatus processObjects(xmlNode* currentNode) = 0;
85 
87  virtual DtFedReadStatus processInteractions(xmlNode* currentNode) = 0;
88 
90  virtual DtFedReadStatus parseObjectTree(xmlNode* currentNode, const DtString& parentName) = 0;
91 
93  virtual DtFedReadStatus parseAttribute(xmlNode* currentNode, const DtString& parentName) = 0;
94 
96  virtual DtFedReadStatus parseAttributeDimensions( xmlNode* currentNode, DtString const& objectClass,
97  DtString const& attribute) = 0;
98 
100  virtual DtFedReadStatus parseInteractionTree(xmlNode* currentNode, const DtString& parentName) = 0;
101 
103  virtual DtFedReadStatus parseInteractionDimensions(xmlNode *currentNode, DtString const& interactionClass) = 0;
104 
106  virtual DtFedReadStatus parseDimensionList(xmlNode* currentNode) = 0;
107 
109  virtual DtFedReadStatus parseDimension(xmlNode* currentNode) = 0;
110 
112  virtual DtFedReadStatus parseSwitches(xmlNode* currentNode) = 0;
113 
115  virtual DtFedReadStatus parseParameter(xmlNode* currentNode, const DtString& parentName) = 0;
116 
118  virtual DtFedReadStatus parseTransportationTree(xmlNode* currentNode);
119 
121  virtual DtFedReadStatus parseDataTypeTree(xmlNode* currentNode) = 0;
122 
124  virtual DtFedReadStatus parseNotesTree(xmlNode* currentNode) = 0;
125 
127  virtual DtFedReadStatus parseTagsTree(xmlNode* currentNode) = 0;
128 
130  virtual DtFedReadStatus parseBasicDataTypesTree(xmlNode* currentNode) = 0;
131 
133  virtual DtFedReadStatus parseSimpleDataTypesTree(xmlNode* currentNode) = 0;
134 
136  virtual DtFedReadStatus parseArrayDataTypesTree(xmlNode* currentNode) = 0;
137 
139  virtual DtFedReadStatus parseEnumeratedDataTypesTree(xmlNode* currentNode) = 0;
140 
142  virtual DtFedReadStatus parseFixedRecordDataTypesTree(xmlNode* currentNode) = 0;
143 
145  virtual DtFedReadStatus parseVariantRecordDataTypesTree(xmlNode* currentNode) = 0;
146 
148  virtual void appendNodeProperties(xmlNode* currentNode, DtString& output) const;
149 
151  virtual void appendNodeContent(xmlNode* node, DtString& output) const;
152 
154  virtual bool isBlankText(xmlNode* node) const;
155 
157  virtual const xmlChar* propertyByName( xmlNode* node, const xmlChar *name);
158 
161  virtual bool getPropertyByName( xmlNode* node, const xmlChar *name, DtString& propertyContent);
162 
164  virtual bool getChildrenContent(xmlNode* node, DtString& content) const;
165 
167  virtual DtString childrenContent(xmlNode* node) const;
168 
171  virtual bool getChildContentByName(xmlNode* node, const xmlChar *name, DtString& childContent);
172 
174  virtual bool convertStringToULong(std::string numericString, unsigned long& value);
175 
177  // template supports char* (or other char like w_char) and also basic_string.
178  template<typename stringType, typename charType> void clipPrefix(stringType& valueSpec, charType c);
179 
180 protected:
181 
184 
185  protected:
186 
189  static const DtString theValueEnabled;
190 
191 };
192 
193 template<typename stringType, typename charType> void DtXmlFedReader::clipPrefix(stringType& valueSpec, charType c)
194 {
195  typename stringType::size_type tokenPos = valueSpec.find_first_not_of(c);
196  if (tokenPos != stringType::npos)
197  {
198  valueSpec.erase(0, tokenPos);
199  }
200 }
201 
202 #ifdef DtUSE_UTILITIES_NAMESPACE
203 }
204 #endif
205 
static const DtString theValuePrivilegeToDelete
Definition: xmlFedReader.h:188
This file contains the declaration of DtFilename.
struct _xmlNode xmlNode
Definition: fedReader.h:21
Contains the DtString class declaration.
Instances of DtFedReader are used to read a FED file, and fill in a DtFedTarget with the information ...
Definition: fedReader.h:51
unsigned char xmlChar
Definition: fedReader.h:19
DtFedTarget * myFedTarget
Definition: xmlFedReader.h:182
Instances of DtXmlFedReader are used to read a FED file, and fill in a DtFedTarget with the informati...
Definition: xmlFedReader.h:38
static const DtString theValueEnabled
Definition: xmlFedReader.h:189
This file declares DtFedReader and several helper classes.
Definition: fedReader.h:41
DtFedReadStatus
Definition: fedReader.h:31
This file contains the declaration of DtFedTarget and several helper classes.
DtFilename myFileBeingRead
Definition: xmlFedReader.h:183
class DtFedTarget:
Definition: vlFedTarget.h:124
static const DtString theValueObjectRoot
Definition: xmlFedReader.h:187
Instances of DtFilename are DtStrings which convert filenames to the native format.
Definition: vlFilename.h:20
void clipPrefix(stringType &valueSpec, charType c)
Clip the characters from beginning of string up to the first occurrence of the given character...
Definition: xmlFedReader.h:193
DtFomType
Definition: vlFedTarget.h:42
#define DT_DLL_MTL
Definition: vlMachineTypes.h:106
Instances of DtString are used to represent strings.
Definition: vlString.h:36

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)