diff --git a/src/util.cpp b/src/util.cpp index 21094061a..40d803da7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -325,53 +325,6 @@ int execute ( // Collides with std::numeric_limits methods #undef max -//////////////////////////////////////////////////////////////////////////////// -// Encode values prior to serialization. -// [ -> &open; -// ] -> &close; -const std::string encode (const std::string& value) -{ - std::string modified = value; - - str_replace (modified, "[", "&open;"); - str_replace (modified, "]", "&close;"); - - return modified; -} - -//////////////////////////////////////////////////////////////////////////////// -// Decode values after parse. -// " <- &dquot; -// ' <- &squot; or " -// , <- , -// [ <- &open; -// ] <- &close; -// : <- : -const std::string decode (const std::string& value) -{ - if (value.find ('&') != std::string::npos) - { - std::string modified = value; - - // Supported encodings. - str_replace (modified, "&open;", "["); - str_replace (modified, "&close;", "]"); - - // Support for deprecated encodings. These cannot be removed or old files - // will not be parsable. Not just old files - completed.data can contain - // tasks formatted/encoded using these. - str_replace (modified, "&dquot;", "\""); - str_replace (modified, """, "'"); - str_replace (modified, "&squot;", "'"); // Deprecated 2.0 - str_replace (modified, ",", ","); // Deprecated 2.0 - str_replace (modified, ":", ":"); // Deprecated 2.0 - - return modified; - } - - return value; -} - //////////////////////////////////////////////////////////////////////////////// // Escapes any unescaped character of type c within the given string // e.g. ' ' -> '\ ' diff --git a/src/util.h b/src/util.h index 3dbb51dbc..1de12dc0c 100644 --- a/src/util.h +++ b/src/util.h @@ -61,8 +61,6 @@ int execute (const std::string&, const std::vector &, const std::st int flock (int, int); #endif -const std::string encode (const std::string&); -const std::string decode (const std::string&); const std::string escape (const std::string&, char); const std::vector indentTree ( diff --git a/test/t.t.cpp b/test/t.t.cpp index a93c198c4..40065ac03 100644 --- a/test/t.t.cpp +++ b/test/t.t.cpp @@ -150,6 +150,9 @@ TODO Task::getDependencies TODO Task::urgency +TODO Task::encode +TODO Task::decode + */ // Task::operator== diff --git a/test/util.t.cpp b/test/util.t.cpp index 4de89d7cd..6eaf2d021 100644 --- a/test/util.t.cpp +++ b/test/util.t.cpp @@ -112,9 +112,6 @@ int main (int argc, char** argv) t.is (indentProject ("one.two"), " two", "indentProject 'one.two' -> ' two'"); t.is (indentProject ("one.two.three"), " three", "indentProject 'one.two.three' -> ' three'"); - // TODO const std::string encode (const std::string& value); - // TODO const std::string decode (const std::string& value); - return 0; }