![]() |
VR-Link API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 #ifndef fedReader_H_ 00007 #define fedReader_H_ 00008 00012 00013 #include <stdio.h> 00014 #include <vlutil/vlFedTarget.h> 00015 #include <vlutil/vlString.h> 00016 00017 00018 #ifdef DtUSE_UTILITIES_NAMESPACE 00019 namespace DtUSE_UTILITIES_NAMESPACE 00020 { 00021 #endif 00022 00023 00024 class DtFilename; 00025 00026 enum DtFedReadStatus 00027 { 00028 DtFedReadOK, 00029 DtCouldNotOpenFed, 00030 DtErrorReadingFed, 00031 DtUnknownFileFormat 00032 }; 00033 00039 class DT_DLL_MTL DtFedReader 00040 { 00041 public: 00042 00044 DtFedReader(); 00045 00047 virtual ~DtFedReader(); 00048 00049 private: 00050 00052 DtFedReader( const DtFedReader& ); 00053 DtFedReader& operator=( const DtFedReader& ); 00054 00055 public: 00056 00059 virtual DtFedReadStatus readFed(const char* fedFileName, 00060 DtFedTarget* fedTarget, bool strictCheckingEnabled=false, bool useDTD=false, bool dontParseSwitches=false ); 00061 00064 virtual DtFedReadStatus readFedFilePtr( FILE* fedFilePtr, DtFedTarget* fedTarget, 00065 DtFilename filename, bool strictCheckingEnabled=false, bool useDTD=false, bool dontParseSwitches=false); 00066 00069 virtual FILE* openFedFile( const char* fileName, bool isBinary = false ); 00070 00072 virtual void setStrictChecking(bool enable); 00073 virtual bool strictChecking() const; 00074 00076 virtual void setExpectedFomType(DtFomType fomType); 00077 virtual DtFomType expectedFomType() const; 00078 00080 virtual DtFomType lastFomType() const; 00081 00083 virtual const DtString& lastError() const; 00084 00085 protected: 00086 00088 virtual DtFomType checkFomType(const char* fedFileName, 00089 void* fedFilePtr ) const; 00090 00092 static bool readFileIntoBuffer( FILE* fileHandle, char** fileBuffer, unsigned int* fileSize ); 00093 00094 protected: 00095 00096 DtFedTarget* myFedTarget; 00097 DtFedReader* myChildReader; 00098 bool myStrictChecking; 00099 bool myDontParseSwitchTable; 00100 00102 DtFomType myExpectedFomType; 00103 00105 DtFomType myLastFomType; 00106 00108 DtString myLastError; 00109 00110 }; 00111 00112 #ifdef DtUSE_UTILITIES_NAMESPACE 00113 } 00114 #endif 00115 00116 00117 #endif 00118