00001 /** @file psMetadataIO.h 00002 * 00003 * @brief Contains metadata input/output functions. 00004 * 00005 * This file defines functions to read and write metadata to/from an external file. 00006 * 00007 * @ingroup Metadata 00008 * 00009 * @author Ross Harman, MHPCC 00010 * @author Robert DeSonia, MHPCC 00011 * 00012 * @version $Revision: 1.9 $ $Name: rel5_0 $ 00013 * @date $Date: 2005/03/07 20:58:50 $ 00014 * 00015 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 00016 */ 00017 #ifndef PS_METADATAIO_H 00018 #define PS_METADATAIO_H 00019 00020 /// @addtogroup Metadata 00021 /// @{ 00022 00023 00024 /** Print metadata item to file. 00025 * 00026 * Metadata items may be printed to an open file descriptor based on a 00027 * provided format. The format is a sprintf format statement with exactly 00028 * one % formatting command. If the metadata item type is a numeric type, 00029 * this formatting command must also be numeric, and the type conversion 00030 * performed to the value to match the format type. If the metadata type is 00031 * a string, the fromatting command must also be for a string. If the 00032 * metadata type is any other data type, printing is not allowed. 00033 * 00034 * @return psMetadataItem* : Pointer metadata item. 00035 */ 00036 bool psMetadataItemPrint( 00037 FILE * fd, ///< Pointer to file to write metadata item. 00038 const char *format, ///< Format to print metadata item. 00039 const psMetadataItem* metadataItem ///< Metadata item to print. 00040 ); 00041 00042 /** Read metadata header. 00043 * 00044 * Read a metadata header from file. If the file is not found, an error is 00045 * reported. 00046 * 00047 * @return psMetadata* : Pointer to resulting metadata. 00048 */ 00049 psMetadata* psMetadataReadHeader( 00050 psMetadata* output, ///< Resulting metadata from read. 00051 char *extName, ///< File name extension string. 00052 psS32 extNum, ///< File name extension number. Starts at 1. 00053 char *fileName ///< Name of file to read. 00054 ); 00055 00056 /** Read metadata configuration file. 00057 * 00058 * Loads pre-defined settings by parsing a configuration file into a psMetadata structure. 00059 * 00060 * @return psMetadata* : Resulting metadata from read. 00061 */ 00062 psMetadata* psMetadataParseConfig( 00063 psMetadata* md, ///< Resulting metadata from read. 00064 psU32 *nFail, ///< Number of failed lines. 00065 const char *fileName, ///< Name of file to read. 00066 psBool overwrite ///< Allow overwrite of duplicate specifications. 00067 ); 00068 00069 /** Read XML metadata configuration file. 00070 * 00071 * Loads pre-defined XML settings by parsing a configuration file into a psMetadata structure. 00072 * 00073 * @return psMetadata* : Resulting metadata from read. 00074 */ 00075 00076 psMetadata* psMetadataParseConfigXml( 00077 psMetadata* md, ///< Resulting metadata from read. 00078 psU32 *nFail, ///< Number of failed lines. 00079 const char *fileName, ///< Name of file to read. 00080 psBool overwrite ///< Allow overwrite of duplicate specifications. 00081 ); 00082 00083 /// @} 00084 00085 #endif
1.3.9.1