Code Cleanup
- Merging Record and Task objects, step 1.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
24
src/Task.cpp
24
src/Task.cpp
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user