From cdfd92ed9b6aaaab0316dad031be1b8561e22841 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 11 Dec 2016 20:00:30 -0500 Subject: [PATCH] Task: Migrated from Nibbler to Pig --- src/Task.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Task.cpp b/src/Task.cpp index a8a2e2ef1..e8b82905c 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -39,7 +39,7 @@ #include #ifdef PRODUCT_TASKWARRIOR #include -#include +#include #endif #include #ifdef PRODUCT_TASKWARRIOR @@ -576,24 +576,24 @@ void Task::parse (const std::string& input) if (input[0] == '[') { - Nibbler n (input); + Pig pig (input); std::string line; - if (n.skip ('[') && - n.getUntil (']', line) && - n.skip (']') && - (n.skip ('\n') || n.depleted ())) + if (pig.skip ('[') && + pig.getUntil (']', line) && + pig.skip (']') && + (pig.skip ('\n') || pig.eos ())) { if (line.length () == 0) throw std::string (STRING_RECORD_EMPTY); - Nibbler nl (line); + Pig attLine (line); std::string name; std::string value; - while (!nl.depleted ()) + while (!attLine.eos ()) { - if (nl.getUntil (':', name) && - nl.skip (':') && - nl.getQuoted ('"', value)) + if (attLine.getUntil (':', name) && + attLine.skip (':') && + attLine.getQuoted ('"', value)) { #ifdef PRODUCT_TASKWARRIOR legacyAttributeMap (name); @@ -605,11 +605,11 @@ void Task::parse (const std::string& input) data[name] = decode (json::decode (value)); } - nl.skip (' '); + attLine.skip (' '); } std::string remainder; - nl.getUntilEOS (remainder); + attLine.getRemainder (remainder); if (remainder.length ()) throw std::string (STRING_RECORD_JUNK_AT_EOL); }