mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 10:07:19 +02:00
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.
This commit is contained in:
parent
627d0a7ae9
commit
17979e10f0
3 changed files with 33 additions and 20 deletions
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "Mod.h"
|
||||||
|
|
||||||
class Att
|
class Att
|
||||||
{
|
{
|
||||||
|
@ -66,7 +67,7 @@ private:
|
||||||
private:
|
private:
|
||||||
std::string mName;
|
std::string mName;
|
||||||
std::string mValue;
|
std::string mValue;
|
||||||
std::vector <std::string> mMods;
|
std::vector <Mod> mMods;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,6 +53,7 @@ Context::Context (const Context& other)
|
||||||
sequence = other.sequence;
|
sequence = other.sequence;
|
||||||
task = other.task;
|
task = other.task;
|
||||||
tdb = other.tdb;
|
tdb = other.tdb;
|
||||||
|
stringtable = other.stringtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -67,6 +68,7 @@ Context& Context::operator= (const Context& other)
|
||||||
sequence = other.sequence;
|
sequence = other.sequence;
|
||||||
task = other.task;
|
task = other.task;
|
||||||
tdb = other.tdb;
|
tdb = other.tdb;
|
||||||
|
stringtable = other.stringtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
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.
|
// Allow user override of file locking. Solaris/NFS machines may want this.
|
||||||
tdb.lock (config.get ("locking", true));
|
tdb.lock (config.get ("locking", true));
|
||||||
|
|
||||||
|
// TODO Load appropriate stringtable.
|
||||||
// TODO Load pending.data.
|
// TODO Load pending.data.
|
||||||
// TODO Load completed.data.
|
// TODO Load completed.data.
|
||||||
// TODO Load deleted.data.
|
// TODO Load deleted.data.
|
||||||
|
@ -122,6 +125,13 @@ int Context::run ()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
int Context::interactive ()
|
||||||
|
{
|
||||||
|
throw std::string ("unimplemented Context::interactive");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Context::loadCorrectConfigFile (int argc, char** argv)
|
void Context::loadCorrectConfigFile (int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "Sequence.h"
|
#include "Sequence.h"
|
||||||
#include "T.h"
|
#include "T.h"
|
||||||
#include "TDB.h"
|
#include "TDB.h"
|
||||||
|
#include "StringTable.h"
|
||||||
|
|
||||||
class Context
|
class Context
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,7 @@ public:
|
||||||
|
|
||||||
void initialize (int, char**);
|
void initialize (int, char**);
|
||||||
int run ();
|
int run ();
|
||||||
|
int interactive ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadCorrectConfigFile (int, char**);
|
void loadCorrectConfigFile (int, char**);
|
||||||
|
@ -56,6 +57,7 @@ public:
|
||||||
Sequence sequence;
|
Sequence sequence;
|
||||||
T task;
|
T task;
|
||||||
TDB tdb;
|
TDB tdb;
|
||||||
|
StringTable stringtable;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue