Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

param_reader.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : param_reader.hpp
00003 // Date         : 12/5/02 (DLR)
00004 // Copyright    : 2002-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the methods and data associated with
00007 //                the ParamReader object.
00008 // Derived From : GStream.
00009 // Modifications:
00010 //************************************************************************************//
00011 #if !defined(PARAM_READER_HPP)
00012 #define PARAM_READER_HPP 
00013 #include "gtypes.h"
00014 #include "gdd_file.h"
00015 #include "gstream.hpp"
00016 #include "gtlist.hpp"
00017 #include <iostream.h>
00018 #include <fstream.h>
00019 #include <stdarg.h>
00020 //#include <varargs.h>
00021 
00022 class ParamReader: public GStream
00023 {
00024 public:
00025                           ParamReader(GBOOL isCollective, GBOOL isIndependent=TRUE, GSHORT  ioTaskID=0);
00026 //                        ParamReader(const ParamReader &);
00027                          ~ParamReader();
00028          void             SetParams(char *format, ...); 
00029          GINT             GetParams(char *filename, char *blk_name,  ...);
00030          void             SetBuffSize(GINT  n);
00031 
00032 private:
00033 //    methods:
00034          GBOOL            LocateBlock(const char *name);
00035          GSHORT           getdata_t(char *sdata, G_DATATYPE dtype, const char *datadelim, const char *termdelim,
00036                                     void *data, const GSHORT  ndata);
00037          GSHORT           getline(char *sbuff, const GINT  num, const char *delim);
00038          GBOOL            getblock(char *sbuff, GINT  num, char *delim0, char *delim1);
00039          GBOOL            ignore(const char *str);
00040          GBOOL            skipblock(const char *delim0, const char *delim1);
00041          char            *rmwhite(char *str);
00042          void             Reset();
00043 
00044 
00045 //    data:
00046          GINT            buffsize_;
00047          GINT            maxParams_;
00048          GStringList     sParamDesc_;
00049          GStringList     sFormat_;
00050 //       char            *serrmsg_;
00051          char            *buff_;
00052          char            delimblk_[2][DELIM_MAX+1];
00053          char            delimeol_   [DELIM_MAX+1];
00054          char            delimlist_  [DELIM_MAX+1];
00055          char            comment_ [3];
00056          ifstream        *os_;
00057 
00058  
00059 };
00060 
00061 #endif

Generated on Wed Dec 21 16:00:48 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4