Files
CDAG/Research/PropertyLoader.h

35 lines
808 B
C++

#pragma once
#include <string>
#include <map>
#include <vector>
class PropertyLoader
{
public:
static void Create();
static void Destroy();
static PropertyLoader* Instance();
void Update();
void Clear();
void AddPropertyFile(std::string file);
std::string GetProperty(const std::string& id);
unsigned GetIntProperty(const std::string& id);
float GetFloatProperty(const std::string& id);
bool GetBoolProperty(const std::string& id);
std::vector<std::string> GetListProperty(const std::string& id);
std::map<std::string, std::string> mProperties;
protected:
private:
PropertyLoader();
~PropertyLoader();
void LoadProperties(const char* fileName);
void LoadDefaults();
static PropertyLoader* mInstance;
std::vector<std::string> mPropertyFiles;
};