- Implemented RegX class to maintain a separate compile, and match
  method, thereby allowing efficient re-use of the regex.  This is
  critical to Expression::eval, where an identical regex might be
  applied to every task.
- Obsoleted rx.{h,cpp}, which combined the compile and match steps
  into a single call, and is therefore not efficient when used in
  the context of filtering.
- Fixed some unit tests that weren't building.  Now they do.  They
  don't work of course (don't be silly) but that's a problem for
  another day.
- Modified all code that relies on rx.h to use RegX.h.
This commit is contained in:
Paul Beckingham 2011-06-21 01:43:57 -04:00
parent aa8d872466
commit b49523c06d
14 changed files with 249 additions and 490 deletions

View file

@ -38,9 +38,8 @@ void get (std::vector <Task>& pending, std::vector <Task>& completed)
TDB tdb;
tdb.location (".");
tdb.lock ();
Filter filter;
tdb.loadPending (pending, filter);
tdb.loadCompleted (completed, filter);
tdb.loadPending (pending);
tdb.loadCompleted (completed);
tdb.unlock ();
}
@ -60,7 +59,6 @@ int main (int argc, char** argv)
context.config.set ("gc", "on");
// Try reading an empty database.
Filter filter;
std::vector <Task> all;
std::vector <Task> pending;
std::vector <Task> completed;
@ -100,7 +98,7 @@ int main (int argc, char** argv)
completed.clear ();
tdb.lock ();
tdb.load (all, filter);
tdb.load (all);
all[0].set ("name", "value2");
tdb.update (all[0]); // P1 C0 N0 M1
tdb.commit (); // P1 C0 N0 M0
@ -118,7 +116,7 @@ int main (int argc, char** argv)
all.clear ();
tdb.lock ();
tdb.loadPending (all, filter);
tdb.loadPending (all);
all[0].setStatus (Task::completed);
tdb.update (all[0]); // P1 C0 N0 M1
Task t2 ("[foo:\"bar\" status:\"pending\"]");