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

CfgFile.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Configuration file parser
00004     Copyright (C) 1999-2001 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <Alloc.hh>
00024 
00025 
00026 #ifndef CFGFILE_HH
00027     #define CFGFILE_HH
00028 
00029 
00030     #define CFGF_MAX_ENTRIES        1024
00031     #define CFGF_BUFSIZE            1024
00032 
00033 
00034     class clCfgFile
00035     {
00036             int iEntryCount;
00037             clAlloc Names[CFGF_MAX_ENTRIES];
00038             clAlloc Values[CFGF_MAX_ENTRIES];
00039             void ReadFile (const char *);
00040             void FreeAll ();
00041         public:
00042             clCfgFile ();
00043             clCfgFile (const char *);
00044             ~clCfgFile ();
00053             void SetFileName (const char *);
00061             bool GetStr (const char *, char *);
00063             bool GetInt (const char *, int *);
00065             bool GetInt (const char *, long *);
00067             bool GetFlt (const char *, float *);
00069             bool GetFlt (const char *, double *);
00071             int GetFltArray (const char *, float *);
00073             int GetFltArray (const char *, double *);
00074     };
00075 
00076 #endif
00077 

Generated on Sun Oct 26 19:11:19 2003 for HASAS by doxygen 1.3.3