aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Kropf <josh@slashdev.ca>2007-07-27 23:00:17 (GMT)
committerJosh Kropf <josh@slashdev.ca>2007-07-27 23:00:17 (GMT)
commit6d82be4fca171d8591105747f3cce093f6c52bdc (patch)
tree9fe8bef0dd62bbc28417a3a037d952bb26256528
parent3e272e0f2cc91bc3822f07891ede1cc4a2f17ff4 (diff)
downloadecho-server-6d82be4fca171d8591105747f3cce093f6c52bdc.zip
echo-server-6d82be4fca171d8591105747f3cce093f6c52bdc.tar.gz
echo-server-6d82be4fca171d8591105747f3cce093f6c52bdc.tar.bz2
removed unused files
-rw-r--r--common/Config.cpp40
-rw-r--r--common/Config.h50
2 files changed, 0 insertions, 90 deletions
diff --git a/common/Config.cpp b/common/Config.cpp
deleted file mode 100644
index 07eba5c..0000000
--- a/common/Config.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "Config.h"
-
-Config::Config()
-{
- cfg_opt_t action_opts[] = {
- CFG_STR("root", 0, CFGF_NODEFAULT),
- CFG_STR_LIST("modules", "{}", CFGF_NONE),
- CFG_END()
- };
-
- cfg_opt_t opts[] = {
- CFG_SEC("actions", action_opts, CFGF_NONE),
- CFG_END()
- };
-
- _cfg = cfg_init(opts, CFGF_NONE);
- if (cfg_parse(_cfg, CONFIG_FILE) == CFG_PARSE_ERROR)
- throw config_error();
-}
-
-Config::~Config()
-{
- cfg_free(_cfg);
-}
-
-vector<string> Config::modules() const
-{
- vector<string> modules;
-
- cfg_t* actions = cfg_getsec(_cfg, "actions");
- if (actions) {
- string root = cfg_getstr(actions, "root");
-
- for (int i=cfg_size(actions, "modules")-1; i>=0; i--) {
- *modules.end() = root + cfg_getnstr(actions, "modules", i);
- }
- }
-
- return modules;
-}
diff --git a/common/Config.h b/common/Config.h
deleted file mode 100644
index 6b27d20..0000000
--- a/common/Config.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <string>
-#include <vector>
-#include <exception>
-#include <confuse.h>
-
-#ifndef CONFIG_H_
-#define CONFIG_H_
-
-#define CONFIG_FILE "/etc/echo.conf"
-
-using namespace std;
-
-
-class config_error: public exception
-{
-public:
- virtual const char* what() {
- return "configuration parse error";
- }
-};
-
-/**
- * Config class encapsulates the config file parsing and provides methods
- * for retreiving configuration options
- */
-class Config
-{
-private:
- cfg_t *_cfg;
-
-public:
-
- /**
- * Creates the config class and parses the config file
- * @throws config_error
- */
- Config();
-
- /**
- * Releases config resources
- */
- ~Config();
-
- /**
- * Returns fully qualified path names to all the configured action modules
- */
- vector<string> modules() const;
-};
-
-#endif /*CONFIG_H_*/