Code Cleanup

- Eliminated obsolete composeYAML and composeCSV methods.  With export
  capabilities moving outside the core, these are no longer needed.
This commit is contained in:
Paul Beckingham 2011-08-29 21:33:34 -04:00
parent 5276bfd473
commit f14b414b9c
2 changed files with 0 additions and 93 deletions

View file

@ -537,97 +537,6 @@ std::string Task::composeF4 () const
return ff4;
}
////////////////////////////////////////////////////////////////////////////////
std::string Task::composeCSV () const
{
std::stringstream out;
// Deliberately no 'id'.
out << "'" << get ("uuid") << "',";
out << "'" << get ("status") << "',";
// Tags
std::vector <std::string> tags;
getTags (tags);
std::string allTags;
join (allTags, " ", tags);
out << "'" << allTags << "',";
out << get ("entry") << ",";
out << get ("start") << ",";
if (has ("due"))
out << get ("due") << ",";
else
out << ",";
if (has ("recur"))
out << get ("recur") << ",";
else
out << ",";
out << get ("end") << ",";
if (has ("project"))
out << "'" << get ("project") << "',";
else
out << ",";
if (has ("priority"))
out << "'" << get ("priority") << "',";
else
out << ",";
if (has ("fg"))
out << "'" << get ("fg") << "',";
else
out << ",";
if (has ("bg"))
out << "'" << get ("bg") << "',";
else
out << ",";
// Convert single quotes to double quotes, because single quotes are used to
// delimit the values that need it.
std::string clean = get ("description");
std::replace (clean.begin (), clean.end (), '\'', '"');
out << "'" << clean << "'\n";
return out.str ();
}
////////////////////////////////////////////////////////////////////////////////
std::string Task::composeYAML () const
{
std::stringstream out;
// Task header.
out << " task:\n";
// Get all the supported attribute names.
std::vector <std::string> names = context.getColumns ();
std::sort (names.begin (), names.end ());
// Only include non-trivial attributes.
std::string value;
std::vector <std::string>::iterator name;
for (name = names.begin (); name != names.end (); ++name)
if ((value = get (*name)) != "")
out << " " << *name << ": " << value << "\n";
// Now the annotations, which are not listed in names.
std::map <std::string, std::string> annotations;
getAnnotations (annotations);
std::map <std::string, std::string>::iterator a;
for (a = annotations.begin (); a != annotations.end (); ++a)
out << " annotation:\n"
<< " entry: " << a->first.substr (11) << "\n"
<< " description: " << a->second << "\n";
return out.str ();
}
////////////////////////////////////////////////////////////////////////////////
std::string Task::composeJSON (bool include_id /*= false*/) const
{

View file

@ -45,8 +45,6 @@ public:
void parse (const std::string&);
std::string composeF4 () const;
std::string composeCSV () const;
std::string composeYAML () const;
std::string composeJSON (bool include_id = false) const;
// Status values.