00001 /*------------------------------------------------------------------------------ 00002 00003 Copyright (c) 2000 Tyrell Corporation. All rights reserved. 00004 00005 Tyrell ConfigSection 00006 00007 File : ConfigSection.h 00008 Version : $Revision: 1.4 $ 00009 Author : $Author: darkeye $ 00010 Location : $Source: /cvsroot/darkice/darkice/src/ConfigSection.h,v $ 00011 00012 Copyright notice: 00013 00014 This program is free software; you can redistribute it and/or 00015 modify it under the terms of the GNU General Public License 00016 as published by the Free Software Foundation; either version 2 00017 of the License, or (at your option) any later version. 00018 00019 This program is distributed in the hope that it will be useful, 00020 but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License 00025 along with this program; if not, write to the Free Software 00026 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00027 00028 ------------------------------------------------------------------------------*/ 00029 #ifndef CONFIG_SECTION_H 00030 #define CONFIG_SECTION_H 00031 00032 #ifndef __cplusplus 00033 #error This is a C++ include file 00034 #endif 00035 00036 00037 /* ============================================================ include files */ 00038 00039 #include <map> 00040 #include <string> 00041 00042 #include "Referable.h" 00043 00044 00045 /* ================================================================ constants */ 00046 00047 00048 /* =================================================================== macros */ 00049 00050 00051 /* =============================================================== data types */ 00052 00070 class ConfigSection : public virtual Referable 00071 { 00072 private: 00073 00077 typedef std::map<std::string, std::string> TableType; 00078 00082 TableType table; 00083 00084 00085 protected: 00086 00087 00088 public: 00089 00095 inline 00096 ConfigSection ( void ) throw ( Exception ) 00097 { 00098 } 00099 00105 inline virtual 00106 ~ConfigSection ( void ) throw ( Exception ) 00107 { 00108 } 00109 00110 00111 /* TODO 00112 00113 inline 00114 ConfigSection ( const ConfigSection & di ) throw ( Exception ) 00115 { 00116 } 00117 00118 00119 inline ConfigSection & 00120 operator= ( const ConfigSection * di ) throw ( Exception ) 00121 { 00122 } 00123 */ 00124 00133 virtual bool 00134 add ( const char * key, 00135 const char * value ) throw ( Exception ); 00136 00144 virtual const char * 00145 get ( const char * key ) const throw ( Exception ); 00146 00157 virtual const char * 00158 getForSure ( const char * key, 00159 const char * message1 = 0, 00160 const char * message2 = 0, 00161 int code = 0 ) const 00162 throw ( Exception ); 00163 00171 virtual bool 00172 addLine ( const char * line ) throw ( Exception ); 00173 }; 00174 00175 00176 /* ================================================= external data structures */ 00177 00178 00179 /* ====================================================== function prototypes */ 00180 00181 00182 00183 #endif /* CONFIG_SECTION_H */ 00184 00185 00186 /*------------------------------------------------------------------------------ 00187 00188 $Source: /cvsroot/darkice/darkice/src/ConfigSection.h,v $ 00189 00190 $Log: ConfigSection.h,v $ 00191 Revision 1.4 2001/09/05 20:11:15 darkeye 00192 removed dependency on locally stored SGI STL header files 00193 now compiler-supplied C++ library STL header files are used 00194 compiles under GNU C++ 3 00195 hash_map (an SGI extension to STL) replaced with map 00196 std:: namespace prefix added to all STL class references 00197 00198 Revision 1.3 2000/11/13 18:46:50 darkeye 00199 added kdoc-style documentation comments 00200 00201 Revision 1.2 2000/11/09 22:08:17 darkeye 00202 added function getForSure 00203 00204 Revision 1.1 2000/11/08 17:29:50 darkeye 00205 added configuration file reader 00206 00207 Revision 1.1.1.1 2000/11/05 10:05:50 darkeye 00208 initial version 00209 00210 00211 ------------------------------------------------------------------------------*/ 00212