Code Cleanup

- Merging Record and Task objects, step 1.
This commit is contained in:
Paul Beckingham
2011-08-07 16:23:23 -04:00
parent 6140f4af9d
commit 6d00337db3
5 changed files with 67 additions and 68 deletions

View File

@@ -55,30 +55,6 @@ Record::~Record ()
{
}
////////////////////////////////////////////////////////////////////////////////
// The format is:
//
// [ Att::composeF4 ... ] \n
//
std::string Record::composeF4 () const
{
std::string ff4 = "[";
bool first = true;
std::map <std::string, Att>::const_iterator it;
for (it = this->begin (); it != this->end (); ++it)
{
if (it->second.value () != "")
{
ff4 += (first ? "" : " ") + it->second.composeF4 ();
first = false;
}
}
ff4 += "]\n";
return ff4;
}
////////////////////////////////////////////////////////////////////////////////
//
// start --> [ --> Att --> ] --> end

View File

@@ -41,8 +41,6 @@ public:
Record (const std::string&); // Copy constructor
virtual ~Record (); // Destructor
std::string composeF4 () const;
std::string composeCSV () const;
void parse (const std::string&);
bool has (const std::string&) const;

View File

@@ -373,6 +373,30 @@ void Task::legacyParse (const std::string& line)
}
}
////////////////////////////////////////////////////////////////////////////////
// The format is:
//
// [ Att::composeF4 ... ] \n
//
std::string Task::composeF4 () const
{
std::string ff4 = "[";
bool first = true;
std::map <std::string, Att>::const_iterator it;
for (it = this->begin (); it != this->end (); ++it)
{
if (it->second.value () != "")
{
ff4 += (first ? "" : " ") + it->second.composeF4 ();
first = false;
}
}
ff4 += "]\n";
return ff4;
}
////////////////////////////////////////////////////////////////////////////////
std::string Task::composeCSV () const
{

View File

@@ -42,6 +42,7 @@ public:
~Task (); // Destructor
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;