src/SAL_config.h

00001 /*
00002     SAL - Simple Application Library
00003     Copyright (C) 2006-2006 Kronon
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019     Kronon
00020     kronon88@users.sourceforge.net
00021 */
00022 
00023 //SAL config file parser
00024 //Created by Kronon
00025 
00026 //Here we change config files in usable values
00027 
00028 #ifndef SAL_CONFIG_H
00029 #define SAL_CONFIG_H
00030 
00031 
00032 #include "global/SAL_dtree.h"
00033 #include "SAL_draw.h"
00034 
00035 #include <fstream>
00036 
00040 struct conf_node
00041 {
00042         string name;                                                            
00043         string value;                                                           
00044 };
00045 
00046 class salConf
00047 {
00048         public:
00049                 //Functions
00050                 salConf(const char * url, int size);
00051                 ~salConf();
00052                 int getInt(string option_name);
00053                 string getString(string option_name);
00054                 TTF_Font * getFont(string option_uri, string option_size);
00055                 Uint32 getColor(string color);
00056         
00057         private:
00058                 //Variables
00059                 int length;                                                             
00060                 conf_node * conf_nodes;                                 
00061                 
00062                 //Funcitons
00063                 Uint32 convert_color(string color);
00064 
00065 };
00066 
00073 #endif