Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

ConfigParser.h

00001 /*****************************************************************************
00002  * Author:   Valient Gough <vgough@pobox.com>
00003  *
00004  *****************************************************************************
00005  * Copyright (c) 2001, Valient Gough
00006  *
00007  * This library is free software; you can distribute it and/or modify it under
00008  * the terms of the GNU Lesser General Public License (LGPL), as published by
00009  * the Free Software Foundation; either version 2.1 of the License, or (at your
00010  * option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014  * FITNESS FOR A PARTICULAR PURPOSE.  See the LGPL in the file COPYING for more
00015  * details.
00016  *
00017  */
00018 
00019 #ifndef _ConfigParser_incl_
00020 #define _ConfigParser_incl_
00021 
00022 #include <rel/VMap.h>
00023 
00024 #include <iostream>
00025 
00026 
00027 // readFromFile is an external entry point for when librel-config is loaded as
00028 // a plugin.  It reads a filename from the input stream and returns a VMapPtr.
00029 extern "C"
00030 rel::OpaqueValue readFromFile(const rel::TypeStream *);
00031 
00032 
00033 namespace rel
00034 {
00035     class ConfigParserLexer;
00036 
00037     class ConfigParser
00038     {
00039     public:
00040         ConfigParser(const SmartPtr<istream> &input);
00041         ConfigParser(const SmartPtr<istream> &input,
00042                 ConfigParserLexer *lexer);
00043         virtual ~ConfigParser();
00044 
00045         static VMapPtr readFromFile(const string &filePath);
00046 
00047         VMapPtr parseStream();
00048 
00049         VMapPtr getCurrentDir();
00050         void setCurrentDir(const VMapPtr &dir);
00051         
00052         // creates and sets current dir
00053         virtual VMapPtr createNewDir();  
00054         
00055         
00056         int lex(const char *&stringResult);
00057 
00058     private:
00059         struct ConfigParserImpl *impl;
00060     };
00061 
00062 } // namespace rel
00063 
00064 #endif
00065 

Generated at Sat Sep 22 02:20:00 2001 for librel by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001