aboutsummaryrefslogtreecommitdiffstats
path: root/src/inifile.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-07-01 21:09:54 +0000
committerlloyd <[email protected]>2006-07-01 21:09:54 +0000
commit6d3a4de1efcb6b04a1ab87037d487f979d7ca445 (patch)
tree02342b193a3808d2010b441480f65aa45a23dc92 /src/inifile.cpp
parent3d1d14cf405111e30643cf4c7674d441cc07a2e0 (diff)
Access the global configuration through an object reference instead
of stand-alone functions. Store the configuration in a distinct object, rather than just a map inside the library state.
Diffstat (limited to 'src/inifile.cpp')
-rw-r--r--src/inifile.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/inifile.cpp b/src/inifile.cpp
index 0923aa584..3fb263aaa 100644
--- a/src/inifile.cpp
+++ b/src/inifile.cpp
@@ -4,9 +4,9 @@
*************************************************/
#include <botan/config.h>
-#include <botan/libstate.h>
#include <botan/charset.h>
#include <botan/parsing.h>
+#include <botan/exceptn.h>
#include <fstream>
#include <map>
@@ -72,20 +72,10 @@ std::string interpolate(const std::string& value,
}
-namespace Config {
-
/*************************************************
* Load a configuration file *
*************************************************/
-void load(const std::string& fsname)
- {
- load(fsname, global_state());
- }
-
-/*************************************************
-* Load a configuration file *
-*************************************************/
-void load(const std::string& fsname, Library_State& state)
+void Config::load_inifile(const std::string& fsname)
{
std::ifstream config(fsname.c_str());
@@ -135,16 +125,14 @@ void load(const std::string& fsname, Library_State& state)
if(section == "oids")
{
- state.set_option("oid2str", name, value, false);
- state.set_option("str2oid", value, name, false);
+ set("oid2str", name, value, false);
+ set("str2oid", value, name, false);
}
else if(section == "aliases")
- state.set_option("alias", name, value);
+ set("alias", name, value);
else
- state.set_option("conf", section + '/' + name, value);
+ set("conf", section + '/' + name, value);
}
}
}
-
-}