From 17979e10f0639859b8cf764dbcbadfd1f8d33661 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 23 May 2009 10:32:07 -0400 Subject: [PATCH] Enhancement - attributes and stringtable - Modified Att to contain a vector of Mods, not std::strings, even though a Mod is a std::string. - Added a StringTable object to Context, to start getting the I18N infrastructure in place before it is needed. Only a few strings are expected to be migrated. --- src/Att.h | 3 ++- src/objects/Context.cpp | 34 ++++++++++++++++++++++------------ src/objects/Context.h | 16 +++++++++------- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/Att.h b/src/Att.h index d0c116cc1..c7ffa5579 100644 --- a/src/Att.h +++ b/src/Att.h @@ -29,6 +29,7 @@ #include #include +#include "Mod.h" class Att { @@ -66,7 +67,7 @@ private: private: std::string mName; std::string mValue; - std::vector mMods; + std::vector mMods; }; #endif diff --git a/src/objects/Context.cpp b/src/objects/Context.cpp index 20233e4eb..b0d5cff5a 100644 --- a/src/objects/Context.cpp +++ b/src/objects/Context.cpp @@ -47,12 +47,13 @@ Context::Context () Context::Context (const Context& other) { throw std::string ("unimplemented Context::Context"); - config = other.config; - filter = other.filter; - keymap = other.keymap; - sequence = other.sequence; - task = other.task; - tdb = other.tdb; + config = other.config; + filter = other.filter; + keymap = other.keymap; + sequence = other.sequence; + task = other.task; + tdb = other.tdb; + stringtable = other.stringtable; } //////////////////////////////////////////////////////////////////////////////// @@ -61,12 +62,13 @@ Context& Context::operator= (const Context& other) throw std::string ("unimplemented Context::operator="); if (this != &other) { - config = other.config; - filter = other.filter; - keymap = other.keymap; - sequence = other.sequence; - task = other.task; - tdb = other.tdb; + config = other.config; + filter = other.filter; + keymap = other.keymap; + sequence = other.sequence; + task = other.task; + tdb = other.tdb; + stringtable = other.stringtable; } return *this; @@ -105,6 +107,7 @@ void Context::initialize (int argc, char** argv) // Allow user override of file locking. Solaris/NFS machines may want this. tdb.lock (config.get ("locking", true)); + // TODO Load appropriate stringtable. // TODO Load pending.data. // TODO Load completed.data. // TODO Load deleted.data. @@ -122,6 +125,13 @@ int Context::run () return 0; } +//////////////////////////////////////////////////////////////////////////////// +int Context::interactive () +{ + throw std::string ("unimplemented Context::interactive"); + return 0; +} + //////////////////////////////////////////////////////////////////////////////// void Context::loadCorrectConfigFile (int argc, char** argv) { diff --git a/src/objects/Context.h b/src/objects/Context.h index c0d50c68a..25557f8fe 100644 --- a/src/objects/Context.h +++ b/src/objects/Context.h @@ -33,7 +33,7 @@ #include "Sequence.h" #include "T.h" #include "TDB.h" - +#include "StringTable.h" class Context { @@ -45,17 +45,19 @@ public: void initialize (int, char**); int run (); + int interactive (); private: void loadCorrectConfigFile (int, char**); public: - Config config; - Filter filter; - Keymap keymap; - Sequence sequence; - T task; - TDB tdb; + Config config; + Filter filter; + Keymap keymap; + Sequence sequence; + T task; + TDB tdb; + StringTable stringtable; private: };