update dict
[QFreeRecite.git] / src / core / ConfigHolder.cpp
blob819acb30af4957f7015a9ef0952219237a5b07fd
1 #include <cstdlib>
2 #include <limits>
3 #include <string>
4 #include "Debug.h"
5 #include "ConfigHolder.h"
7 namespace freeRecite {
9 ConfigHolder::ConfigHolder() {
10 //Do Nothing Here!
13 void ConfigHolder::load(const char *rootDir,
14 const char *gDir, const char *soundDir) {
15 rootDirectory = rootDir;
16 globalDirectory = gDir;
17 if(soundDir != 0)
18 soundDirectory = soundDir;
19 #ifdef DEBUG
20 std::cerr << "rootDir() " << this->rootDir() << std::endl;
21 std::cerr << "tasksDir()" << tasksDir() << std::endl;
22 std::cerr << "mgrFile()" << mgrFile() << std::endl;
23 std::cerr << "localDictFile()" << localDictFile() << std::endl;
24 std::cerr << "globalDictFile()" << globalDictFile() << std::endl;
25 std::cerr << "keyFile()" << keyFile() << std::endl;
26 std::cerr << "doneFile()" << doneFile() << std::endl;
27 #endif //DEBUG
30 void ConfigHolder::setRootDir(const char *dir) {
31 rootDirectory = dir;
34 void ConfigHolder::setGlobalDir(const char *dir) {
35 globalDirectory = dir;
38 void ConfigHolder::soundDir(const char *dir) {
39 soundDirectory = dir;
43 const std::vector<unsigned> *ConfigHolder::e_list() {
44 initPt.clear();
45 initPt.push_back(0); //list[0] is just a placeholder.
46 return &initPt;
49 const std::vector<unsigned> *ConfigHolder::r_list() {
50 initPt.clear();
51 initPt.push_back(0); //list[0] is just a placeholder.
52 initPt.push_back(1);
53 initPt.push_back(3);
54 initPt.push_back(5);
55 return &initPt;
58 const std::vector<unsigned> *ConfigHolder::s_list() {
59 initPt.clear();
60 initPt.push_back(0); //list[0] is just a placeholder.
61 initPt.push_back(3);
62 initPt.push_back(5);
63 initPt.push_back(std::numeric_limits<unsigned>::max());
64 return &initPt;
67 const std::vector<unsigned> *ConfigHolder::t_list() {
68 initPt.clear();
69 initPt.push_back(0); //list[0] is just a placeholder.
70 return &initPt;
74 //This is a global variable.
75 ConfigHolder configHolder;
77 }//End of namespaec freeRecite.