00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef CONFIG_H
00017 #define CONFIG_H
00018
00019 #include <string>
00020 #include <deque>
00021 using std::deque;
00022 using std::string;
00023
00024 class Config
00025 {
00026 public:
00027 typedef deque<string> DHList;
00028 typedef DHList::iterator DHList_Iter;
00029 typedef DHList::const_iterator DHList_CIter;
00030
00031 public:
00032 Config ();
00033 ~Config ();
00034
00035 int load_project (const string& fname_);
00036 int save_project ();
00037
00038 void save_config ();
00039 void load_config ();
00040
00041 void dont_save_project () { m_dont_save_project = true; }
00042
00043
00044 void set_proj_name (const string& name_) { m_proj_name = name_; }
00045 void set_proj_path (const string& path_) { m_path_name = path_; }
00046 void set_A_prefix (const string& ap_) { m_A_prefix = ap_; }
00047 void set_B_prefix (const string& bp_) { m_B_prefix = bp_; }
00048 void set_A_dir (const string& ad_) { m_A_dir = ad_; }
00049 void set_B_dir (const string& bd_) { m_B_dir = bd_; }
00050 void set_pre_delay (const string& pd_) { m_pre_delay = pd_; }
00051 void set_post_delay (const string& pd_) { m_post_delay = pd_; }
00052 void set_jump_next_row (bool b_) { m_jump_next_row =b_; }
00053
00054 const string& get_proj_name () const { return m_proj_name; }
00055 const string& get_proj_path () const { return m_path_name; }
00056 const string& get_A_prefix () const { return m_A_prefix; }
00057 const string& get_B_prefix () const { return m_B_prefix; }
00058 const string& get_A_dir () const { return m_A_dir; }
00059 const string& get_B_dir () const { return m_B_dir; }
00060 const string& get_pre_delay () const { return m_pre_delay; }
00061 const string& get_post_delay () const { return m_post_delay; }
00062 bool get_jump_next_row () const { return m_jump_next_row; }
00063
00064
00065 string make_pathname (const string& type_, const string& name_,
00066 bool absolute_ = false) const;
00067 string make_abs_pathname (const string& type_, const string& name_) const;
00068 string make_rel_pathname (const string& type_, const string& name_) const;
00069 string make_pause_pathname (int type_, const string& name_) const;
00070
00071
00072 string add_document_history ();
00073 void remove_document_history (const string& fullpath_);
00074
00075 const DHList& get_document_history () const { return m_history; }
00076
00077
00078 void dump () const;
00079 void dump_document_history () const;
00080
00081 private:
00082 Config (const Config&);
00083 Config& operator= (const Config&);
00084
00085 private:
00086 string m_proj_name;
00087 string m_path_name;
00088 bool m_dont_save_project;
00089
00090 string m_A_prefix;
00091 string m_B_prefix;
00092 string m_A_dir;
00093 string m_B_dir;
00094 string m_pre_delay;
00095 string m_post_delay;
00096
00097 bool m_jump_next_row;
00098
00099 DHList m_history;
00100
00101 };
00102
00103
00104
00105
00106
00107 inline string
00108
00109 Config::make_abs_pathname (const string& type_, const string& name_) const
00110 {
00111 return make_pathname (type_, name_, true);
00112 }
00113
00114 inline string
00115
00116 Config::make_rel_pathname (const string& type_, const string& name_) const
00117 {
00118 return make_pathname (type_, name_);
00119 }
00120
00121
00122 #endif