mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-07 04:38:34 +02:00
FF4 - Snapshot
- Sketched out Filter - Implemented part of TDB
This commit is contained in:
parent
f97dff0125
commit
e754fa6eac
9 changed files with 34 additions and 15 deletions
|
@ -152,14 +152,24 @@ bool Att::internal () const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TODO Encode values prior to serialization.
|
||||
// Encode values prior to serialization.
|
||||
// \t -> &tab;
|
||||
// " -> "
|
||||
// , -> ,
|
||||
// [ -> &open;
|
||||
// ] -> &close;
|
||||
void Att::encode (std::string&) const
|
||||
{
|
||||
throw std::string ("unimplemented Att::internal");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TODO Decode values after parse.
|
||||
// Decode values after parse.
|
||||
// \t <- &tab;
|
||||
// " <- "
|
||||
// , <- ,
|
||||
// [ <- &open;
|
||||
// ] <- &close;
|
||||
void Att::decode (std::string&) const
|
||||
{
|
||||
throw std::string ("unimplemented Att::internal");
|
||||
|
|
|
@ -80,8 +80,8 @@ Context::~Context ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::initialize (int argc, char** argv)
|
||||
{
|
||||
// Load the config file from the home directory. If the file cannot be
|
||||
// found, offer to create a sample one.
|
||||
// Load the configuration file from the home directory. If the file cannot
|
||||
// be found, offer to create a sample one.
|
||||
loadCorrectConfigFile (argc, argv);
|
||||
|
||||
// When redirecting output to a file, do not use color, curses.
|
||||
|
|
|
@ -59,15 +59,20 @@ Filter::~Filter ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Filter::add (Att& att)
|
||||
{
|
||||
throw std::string ("unimplemented Filter::add");
|
||||
mAtts.push_back (att);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Filter::pass (T&)
|
||||
bool Filter::pass (Record& record)
|
||||
{
|
||||
throw std::string ("unimplemented Filter::pass");
|
||||
return false;
|
||||
/*
|
||||
foreach (att, mAtts)
|
||||
if (! att->match (record))
|
||||
return false;
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include <vector>
|
||||
#include "Att.h"
|
||||
#include "T.h"
|
||||
#include "Record.h"
|
||||
|
||||
class Filter
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
~Filter (); // Destructor
|
||||
|
||||
void add (Att&);
|
||||
bool pass (T&);
|
||||
bool pass (Record&);
|
||||
|
||||
private:
|
||||
std::vector <Att> mAtts;
|
||||
|
|
|
@ -37,7 +37,6 @@ Sequence::Sequence ()
|
|||
Sequence::Sequence (const Sequence& other)
|
||||
{
|
||||
throw std::string ("unimplemented Sequence::Sequence");
|
||||
mSequence = other.mSequence;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -46,7 +45,6 @@ Sequence& Sequence::operator= (const Sequence& other)
|
|||
throw std::string ("unimplemented Sequence::operator=");
|
||||
if (this != &other)
|
||||
{
|
||||
mSequence = other.mSequence;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class Sequence
|
||||
class Sequence : public std::vector <int>
|
||||
{
|
||||
public:
|
||||
Sequence (); // Default constructor
|
||||
|
@ -39,9 +39,6 @@ public:
|
|||
~Sequence (); // Destructor
|
||||
|
||||
void parse (const std::string&);
|
||||
|
||||
private:
|
||||
std::vector <int> mSequence;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -66,6 +66,7 @@ T::~T ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// [name:value, name:"value",name:[name:value,name:value]]
|
||||
std::string T::composeF4 ()
|
||||
{
|
||||
throw std::string ("unimplemented T::composeF4");
|
||||
|
|
|
@ -148,6 +148,10 @@ void TDB::unlock ()
|
|||
int TDB::load (std::vector <T>& tasks, Filter& filter)
|
||||
{
|
||||
throw std::string ("unimplemented TDB::load");
|
||||
|
||||
// TODO Read each row.
|
||||
// TODO Let T::parse disassemble it.
|
||||
// TODO If task passes filter, add to tasks.
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -156,6 +160,9 @@ int TDB::load (std::vector <T>& tasks, Filter& filter)
|
|||
void TDB::add (T& after)
|
||||
{
|
||||
throw std::string ("unimplemented TDB::add");
|
||||
|
||||
// TODO Seek to end of pending.
|
||||
// TODO write after.composeFF4 ().
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -21,6 +21,7 @@ int main (int argc, char** argv)
|
|||
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "task internal error." << std::endl;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue