pppc/Config.h
joshholtrop 3c22f00c7d fleshing out Config::read() more
git-svn-id: http://apu.dw.local/svnusers/JoshHoltrop/pppc/trunk@53 8131a0b2-b21c-1c47-bd6a-f003126495bd
2009-08-19 17:41:22 +00:00

39 lines
852 B
C++

#ifndef CONFIG_H
#define CONFIG_H
#include <string>
#include <vector>
#include <utility> /* pair */
class Config
{
public:
enum Action { NONE, ON, OFF, PREVIOUS };
class Entry
{
public:
Entry(const std::string & name);
std::string name;
int pin;
Action on_start;
Action on_exit;
Action on_lock;
Action on_unlock;
protected:
};
std::string port;
std::vector<Entry> entries;
Config();
void read(const char * file);
protected:
std::pair<std::string, std::string> split(const std::string & line);
Action parseAction(const std::string & str);
};
#endif