ini_parser.h

Go to the documentation of this file.
00001 #ifndef INI_PARSER_CLASS
00002 #define INI_PARSER_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : ini_parser                                                        *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2000-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "opsysdll.h"
00019 
00020 #include <data_struct/table_configurator.h>
00021 
00023 
00073 class OPSYSTEM_CLASS_STYLE ini_parser : public table_configurator
00074 {
00075 public:
00076   ini_parser(const istring &to_parse,
00077           treatment_of_defaults behavior = RETURN_ONLY);
00079 
00082   ~ini_parser();
00083 
00084   void reset(const istring &to_parse);
00086 
00087   void add(const istring &to_parse);
00089 
00094   bool well_formed() const { return _well_formed; }
00096 
00097   bool restate(istring &new_ini, bool add_spaces = false);
00099 
00102   void merge_section(const istring &section_name, const string_table &to_merge);
00104 
00108 private:
00109   bool _well_formed;  
00110   istring *_preface;  
00111 
00112   void chow_through_eol(istring &to_chow);
00114 
00115   bool parse_section(istring &to_parse, istring &section_name);
00117 
00119 };
00120 
00121 #endif
00122 

Generated on Fri Nov 28 04:29:29 2008 for HOOPLE Libraries by  doxygen 1.5.1