Filter:   InfoImg
download uopconfig.h
Language: C++
LOC: 50
Project Info
Ultima Online Project(uop)
Server: SourceForge
Type: cvs
SourceForge\u\uop\uop\uop\
   acinclude.m4
   aclocal.m4
   action.cc
   action.h
   animation.cc
   animation.h
   artexport.cc
   artfactory.cc
   artfactory.h
   audio.cc
   audio.h
   btree.cc
   btree.h
   cache.h
   cliloc.cc
   cliloc.h
   config.h.in
   configure.in
   cvs2cl.pl
   entity.cc
   entity.h
   gumps.cc
   gumps.h
   interface.cc
   interface.h
   interfacegumps.cc
   interfacegumps.h
   interfacehandler.cc
   interfacehandler.h
   intrface.def
   Makefile.am
   Makefile.in
   message.cc
   message.h
   musicmap.def
   network.cc
   network.h
   patchhandler.cc
   patchhandler.h
   readable.pl
   serverhandler.cc
   serverhandler.h
   sprite.cc
   sprite.h
   stamp-h.in
   texthandler.cc
   texthandler.h
   tiledata.cc
   tiledata.h
   unreadable.pl
   uop.cc
   uop.cfg
   uop.dox
   uop.h
   uopconfig.cc
   uopconfig.h
   uosprite.h
   uostub.pl
   world.cc
   world.h

#ifndef __UOPCONFIG_H__
#define __UOPCONFIG_H__

#include <SDL/SDL.h>
#include <fstream>
#include <string>
#include <map>

class UOPConfig
{
 public:
	 UOPConfig();
	 virtual ~UOPConfig();
	 bool keyIsValid(string key);
	 bool getBoolean(string key);
	 Sint32 getDWord(string key);
	 string getString(string key);
	 virtual void loadKeys();
	 virtual void saveKeys();

	 // Utility functions
	 string encapDatLoc(string filename) {return getString("DataDir")+"/"+filename;}
	 string serverIP();
	 Uint16 serverPort();
 protected:
	 void initDefaults();
	 map<string, bool> boolValues;
	 map<string, Sint32> dWordValues;
	 map<string, string> stringValues;
};

#ifdef WIN32
#include <windows.h>

class WindowsConfig : public UOPConfig
{
 public:
	 void loadKeys();
	 void saveKeys();
 protected:
	 void initRegistry();
	 void deinitRegistry();
	 HKEY hKey;
};

#else

class TextConfig : public UOPConfig
{
 public:
	void loadKeys();
	void saveKeys();
 protected:
	void parseFile(ifstream &configfile);
	string sourcePath;
};

#endif

#endif