IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 16, 2005, 10:13:20 AM (21 years ago)
Author:
drobbin
Message:

Created XML interface for psLib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/xml/psXML.h

    r4540 r4786  
    11/** @file  psXML.h
    22 *
    3  *  @brief Contains XML functions.
     3 *  @brief Contains basic XML definitions and operations
    44 *
    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.
    67 *
    78 *  @ingroup XML
    89 *
    9  *  @author Ross Harman, MHPCC
    10  *  @author Robert DeSonia, MHPCC
     10 *  @author David Robbins, MHPCC
    1111 *
    12  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-07-12 19:12:01 $
     12 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-08-16 20:13:20 $
    1414 *
    15  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     15 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
    1616 */
     17
    1718#ifndef PS_XML_H
    1819#define PS_XML_H
    1920
     21//#include <libxml/parser.h>
     22#include <libxml/tree.h>
     23#include <string.h>
     24#include <ctype.h>
     25#include <limits.h>
     26
    2027#include "psMetadata.h"
    2128#include "psMetadataConfig.h"
     29#include "psMemory.h"
     30#include "psError.h"
     31#include "psString.h"
     32#include "psConstants.h"
     33#include "psErrorText.h"
     34
    2235
    2336/// @addtogroup XML
    2437/// @{
    2538
    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 */
     40typedef 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*/
     53psXMLDoc *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*/
     59psXMLDoc *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*/
     67psMetadata *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*/
     75psXMLDoc *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*/
     83bool 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*/
     92psXMLDoc *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*/
     101bool 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*/
     111psXMLDoc *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*/
     119bool psXMLDocToFD(
     120    const psXMLDoc *doc,               ///< psXMLDoc to read
     121    int fd                             ///< File descriptor to write
    31122);
    32123
     
    34125
    35126#endif // #ifndef PS_XML_H
     127
Note: See TracChangeset for help on using the changeset viewer.