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-2026 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 
97  virtual DtFedReadStatus parseDirectedInteraction(xmlNode* currentNode, const DtString& parentName);
98 
100  virtual DtFedReadStatus parseAttributeDimensions( xmlNode* currentNode, DtString const& objectClass,
101  DtString const& attribute) = 0;
102 
104  virtual DtFedReadStatus parseInteractionTree(xmlNode* currentNode, const DtString& parentName) = 0;
105 
107  virtual DtFedReadStatus parseInteractionDimensions(xmlNode *currentNode, DtString const& interactionClass) = 0;
108 
110  virtual DtFedReadStatus parseDimensionList(xmlNode* currentNode) = 0;
111 
113  virtual DtFedReadStatus parseDimension(xmlNode* currentNode) = 0;
114 
116  virtual DtFedReadStatus parseSwitches(xmlNode* currentNode) = 0;
117 
119  virtual DtFedReadStatus parseParameter(xmlNode* currentNode, const DtString& parentName) = 0;
120 
122  virtual DtFedReadStatus parseTransportationTree(xmlNode* currentNode);
123 
125  virtual DtFedReadStatus parseDataTypeTree(xmlNode* currentNode) = 0;
126 
128  virtual DtFedReadStatus parseNotesTree(xmlNode* currentNode) = 0;
129 
131  virtual DtFedReadStatus parseTagsTree(xmlNode* currentNode) = 0;
132 
134  virtual DtFedReadStatus parseBasicDataTypesTree(xmlNode* currentNode) = 0;
135 
137  virtual DtFedReadStatus parseSimpleDataTypesTree(xmlNode* currentNode) = 0;
138 
140  virtual DtFedReadStatus parseArrayDataTypesTree(xmlNode* currentNode) = 0;
141 
143  virtual DtFedReadStatus parseEnumeratedDataTypesTree(xmlNode* currentNode) = 0;
144 
146  virtual DtFedReadStatus parseFixedRecordDataTypesTree(xmlNode* currentNode) = 0;
147 
149  virtual DtFedReadStatus parseVariantRecordDataTypesTree(xmlNode* currentNode) = 0;
150 
152  virtual void appendNodeProperties(xmlNode* currentNode, DtString& output) const;
153 
155  virtual void appendNodeContent(xmlNode* node, DtString& output) const;
156 
158  virtual bool isBlankText(xmlNode* node) const;
159 
161  virtual const xmlChar* propertyByName( xmlNode* node, const xmlChar *name);
162 
165  virtual bool getPropertyByName( xmlNode* node, const xmlChar *name, DtString& propertyContent);
166 
168  virtual bool getChildrenContent(xmlNode* node, DtString& content) const;
169 
171  virtual DtString childrenContent(xmlNode* node) const;
172 
175  virtual bool getChildContentByName(xmlNode* node, const xmlChar *name, DtString& childContent);
176 
178  virtual bool convertStringToULong(std::string numericString, unsigned long& value);
179 
181  // template supports char* (or other char like w_char) and also basic_string.
182  template<typename stringType, typename charType> void clipPrefix(stringType& valueSpec, charType c);
183 
184 protected:
185 
188 
189  protected:
190 
193  static const DtString theValueEnabled;
194 
195 };
196 
197 template<typename stringType, typename charType> void DtXmlFedReader::clipPrefix(stringType& valueSpec, charType c)
198 {
199  typename stringType::size_type tokenPos = valueSpec.find_first_not_of(c);
200  if (tokenPos != stringType::npos)
201  {
202  valueSpec.erase(0, tokenPos);
203  }
204 }
205 
206 #ifdef DtUSE_UTILITIES_NAMESPACE
207 }
208 #endif
209 
static const DtString theValuePrivilegeToDelete
Definition: xmlFedReader.h:192
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:186
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:193
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:187
class DtFedTarget:
Definition: vlFedTarget.h:124
static const DtString theValueObjectRoot
Definition: xmlFedReader.h:191
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:197
DtFomType
Definition: vlFedTarget.h:42
#define DT_DLL_MTL
Definition: vlMachineTypes.h:118
Instances of DtString are used to represent strings.
Definition: vlString.h:38

Document ID: Generated on Mon Sep 28 00:09:32 EDT 2026 from SVN revision 295353
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)