Changeset 4786 for trunk/psLib/src/xml/psXML.h
- Timestamp:
- Aug 16, 2005, 10:13:20 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/xml/psXML.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/xml/psXML.h
r4540 r4786 1 1 /** @file psXML.h 2 2 * 3 * @brief Contains XML functions.3 * @brief Contains basic XML definitions and operations 4 4 * 5 * This file defines functions to read metadata from an XML file. 5 * This file defines the basic type for an XML struct and functions useful 6 * in creation and usage of XML documents/files. 6 7 * 7 8 * @ingroup XML 8 9 * 9 * @author Ross Harman, MHPCC 10 * @author Robert DeSonia, MHPCC 10 * @author David Robbins, MHPCC 11 11 * 12 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 7-12 19:12:01$12 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-08-16 20:13:20 $ 14 14 * 15 * Copyright 200 4-2005 Maui High Performance Computing Center, University of Hawaii15 * Copyright 2005 Maui High Performance Computing Center, University of Hawaii 16 16 */ 17 17 18 #ifndef PS_XML_H 18 19 #define PS_XML_H 19 20 21 //#include <libxml/parser.h> 22 #include <libxml/tree.h> 23 #include <string.h> 24 #include <ctype.h> 25 #include <limits.h> 26 20 27 #include "psMetadata.h" 21 28 #include "psMetadataConfig.h" 29 #include "psMemory.h" 30 #include "psError.h" 31 #include "psString.h" 32 #include "psConstants.h" 33 #include "psErrorText.h" 34 22 35 23 36 /// @addtogroup XML 24 37 /// @{ 25 38 26 psMetadata* psMetadataConfigParseXml( 27 psMetadata* md, ///< Resulting metadata from read. 28 psU32 *nFail, ///< Number of failed lines. 29 const char *fileName, ///< Name of file to read. 30 psBool overwrite ///< Allow overwrite of duplicate specifications. 39 /** XML wrapper pointing to an XML document in memory */ 40 typedef xmlDocPtr psXMLDoc; 41 42 43 /*****************************************************************************/ 44 45 /* FUNCTION PROTOTYPES */ 46 47 /*****************************************************************************/ 48 49 /** Allocates a new psXMLDoc 50 * 51 * @return psXMLDoc* a new psXMLDoc object 52 */ 53 psXMLDoc *psXMLDocAlloc(void); 54 55 /** Converts a psMetadata data structure to a complete psXMLDoc (in memory) 56 * 57 * @return psXMLDoc* Pointer to XML document from read 58 */ 59 psXMLDoc *psMetadataToXMLDoc( 60 const psMetadata *md ///< psMetadata structure to read 61 ); 62 63 /** Converts a complete psXMLDoc (in memory) to a psMetadata data structure 64 * 65 * @return psMetadata* Pointer to psMetadata data structure from read 66 */ 67 psMetadata *psXMLDocToMetadata( 68 const psXMLDoc *doc ///< psXMLDoc to read 69 ); 70 71 /** Loads the data in a named file into a complete psXMLDoc (in memory) 72 * 73 * @return psXMLDoc* Pointer to resulting XML document from read 74 */ 75 psXMLDoc *psXMLParseFile( 76 const char *filename ///< Filename of file to be read 77 ); 78 79 /** Writes out a complete psXMLDoc (in memory) to a named file 80 * 81 * @return bool: True on success or false otherwise. 82 */ 83 bool psXMLDocToFile( 84 const psXMLDoc *doc, ///< psXMLDoc to read 85 const char *filename ///< Filename of file to be written 86 ); 87 88 /** Accepts a block of memory and parses it into a complete psXMLDoc (also in memory) 89 * 90 * @return psXMLDoc* Pointer to resulting XML document from read 91 */ 92 psXMLDoc *psXMLParseMem( 93 const char *buffer, ///< Buffer to read 94 int size ///< Size of buffer 95 ); 96 97 /** Accepts a complete psXMLDoc (in memory) and parses it into a block of memory 98 * 99 * @return bool: True on success or false otherwise. 100 */ 101 bool psXMLDocToMem( 102 const psXMLDoc *doc, ///< psXMLDoc to read 103 char *buffer ///< Buffer to write 104 ); 105 106 /** Reads from a file descriptor and converts the incoming data to a complete 107 * psXMLDoc (in memory) 108 * 109 * @return psXMLDoc* Pointer to resulting XML document from read 110 */ 111 psXMLDoc *psXMLParseFD( 112 int fd ///< File descriptor to read 113 ); 114 115 /** Reads from a complete psXMLDoc (in memory) and writes it to a file descriptor 116 * 117 * @return bool: True on success or false otherwise. 118 */ 119 bool psXMLDocToFD( 120 const psXMLDoc *doc, ///< psXMLDoc to read 121 int fd ///< File descriptor to write 31 122 ); 32 123 … … 34 125 35 126 #endif // #ifndef PS_XML_H 127
Note:
See TracChangeset
for help on using the changeset viewer.
