pppc/Config.h
joshholtrop 17ecf5a6f7 removed unnecessary 'protected:'
git-svn-id: http://apu.dw.local/svnusers/JoshHoltrop/pppc/trunk@67 8131a0b2-b21c-1c47-bd6a-f003126495bd
2009-09-15 19:15:07 +00:00

40 lines
914 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;
};
std::string port;
std::vector<Entry> entries;
Config();
void read(const char * file);
size_t num_entries() const { return entries.size(); }
protected:
void reset();
std::pair<std::string, std::string> split(const std::string & line);
Action parseAction(const std::string & str);
};
#endif