mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Enhancement - Object integration
- Began the big integration festival by moving all objects out of the sandbox. - Hooked up one error message to context.stringtable, just to make a point.
This commit is contained in:
parent
fe4c8f3a9d
commit
97145fbb07
11 changed files with 36 additions and 12 deletions
|
@ -34,6 +34,13 @@
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Context::Context ()
|
Context::Context ()
|
||||||
|
: config ()
|
||||||
|
, filter ()
|
||||||
|
, keymap ()
|
||||||
|
, sequence ()
|
||||||
|
, task ()
|
||||||
|
, tdb ()
|
||||||
|
, stringtable ()
|
||||||
{
|
{
|
||||||
// Set up randomness.
|
// Set up randomness.
|
||||||
#ifdef HAVE_SRANDOM
|
#ifdef HAVE_SRANDOM
|
|
@ -1,10 +1,11 @@
|
||||||
bin_PROGRAMS = task
|
bin_PROGRAMS = task
|
||||||
task_SOURCES = Config.cpp Date.cpp Record.cpp T.cpp TDB.cpp Att.cpp Mod.cpp \
|
task_SOURCES = Config.cpp Date.cpp Record.cpp T.cpp T2.cpp TDB.cpp TDB2.cpp \
|
||||||
Filter.cpp Sequence.cpp Table.cpp Grid.cpp Timer.cpp \
|
Att.cpp Mod.cpp Filter.cpp Sequence.cpp Table.cpp Grid.cpp \
|
||||||
Duration.cpp StringTable.cpp Location.cpp Subst.cpp Keymap.cpp \
|
Timer.cpp Duration.cpp StringTable.cpp Location.cpp Subst.cpp \
|
||||||
Nibbler.cpp color.cpp parse.cpp task.cpp command.cpp edit.cpp \
|
Keymap.cpp Nibbler.cpp Context.cpp color.cpp parse.cpp \
|
||||||
report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h \
|
task.cpp command.cpp edit.cpp report.cpp util.cpp text.cpp \
|
||||||
Date.h Record.h T.h TDB.h Att.h Mod.h Filter.h Sequence.h \
|
rules.cpp import.cpp Config.h Date.h Record.h T.h TDB.h Att.h \
|
||||||
Table.h Grid.h Timer.h Duration.h StringTable.h Location.h \
|
Mod.h Filter.h Sequence.h Table.h Grid.h Timer.h Duration.h \
|
||||||
Subst.h Keymap.h Nibbler.h color.h task.h
|
StringTable.h Location.h Subst.h Keymap.h Nibbler.h Context.h \
|
||||||
|
color.h task.h
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,8 @@ StringTable::~StringTable ()
|
||||||
// ...
|
// ...
|
||||||
void StringTable::load (const std::string& file)
|
void StringTable::load (const std::string& file)
|
||||||
{
|
{
|
||||||
|
mMapping.clear (); // Allows dynamic reload.
|
||||||
|
|
||||||
std::ifstream in;
|
std::ifstream in;
|
||||||
in.open (file.c_str (), std::ifstream::in);
|
in.open (file.c_str (), std::ifstream::in);
|
||||||
if (in.good ())
|
if (in.good ())
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "Nibbler.h"
|
||||||
#include "T2.h"
|
#include "T2.h"
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -56,6 +57,11 @@ T2::~T2 ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void T2::legacyParse (const std::string& input)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// [name:value, name:"value",name:[name:value,name:value]]
|
// [name:value, name:"value",name:[name:value,name:value]]
|
||||||
std::string T2::composeF4 ()
|
std::string T2::composeF4 ()
|
|
@ -38,6 +38,7 @@ public:
|
||||||
T2& operator= (const T2&); // Assignment operator
|
T2& operator= (const T2&); // Assignment operator
|
||||||
~T2 (); // Destructor
|
~T2 (); // Destructor
|
||||||
|
|
||||||
|
void legacyParse (const std::string&);
|
||||||
std::string composeF4 ();
|
std::string composeF4 ();
|
||||||
std::string composeCSV ();
|
std::string composeCSV ();
|
||||||
|
|
|
@ -2,9 +2,10 @@ PROJECT = 1.8
|
||||||
CFLAGS = -I. -I.. -Wall -pedantic -ggdb3 -fno-rtti -fno-stack-check
|
CFLAGS = -I. -I.. -Wall -pedantic -ggdb3 -fno-rtti -fno-stack-check
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
LIBS =
|
LIBS =
|
||||||
OBJECTS = main.o Context.o TDB2.o T2.o ../Sequence.o ../Filter.o ../Att.o \
|
OBJECTS = main.o ../Context.o ../TDB2.o ../T2.o ../Sequence.o ../Filter.o \
|
||||||
../Keymap.o ../Record.o ../Mod.o ../StringTable.o ../util.o \
|
../Att.o ../Keymap.o ../Record.o ../Mod.o ../StringTable.o \
|
||||||
../text.o ../Date.o ../Config.o ../Location.o ../Subst.o ../Nibbler.o
|
../util.o ../text.o ../Date.o ../Config.o ../Location.o ../Subst.o \
|
||||||
|
../Nibbler.o
|
||||||
|
|
||||||
all: $(PROJECT)
|
all: $(PROJECT)
|
||||||
|
|
||||||
|
|
|
@ -317,8 +317,13 @@ int main (int argc, char** argv)
|
||||||
srand (time (NULL));
|
srand (time (NULL));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// TODO 1.8.0 requires the Context.
|
||||||
|
Context context;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
context.initialize (argc, argv);
|
||||||
|
|
||||||
// Load the config file from the home directory. If the file cannot be
|
// Load the config file from the home directory. If the file cannot be
|
||||||
// found, offer to create a sample one.
|
// found, offer to create a sample one.
|
||||||
Config conf;
|
Config conf;
|
||||||
|
@ -365,7 +370,7 @@ int main (int argc, char** argv)
|
||||||
|
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
std::cerr << "Unknown error." << std::endl;
|
std::cerr << context.stringtable.get (100, "Unknown error.") << std::endl;
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include "Context.h"
|
||||||
#include "T.h"
|
#include "T.h"
|
||||||
#include "TDB.h"
|
#include "TDB.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue