mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Dependencies
- Added 'depends' as a valid report column. - Added 'depends' to the 'long' report. - Updated hook.format*t unit tests to accommodate new long report. - Added new join () function that handles std::vector<int>. - Updated text.t unit tests.
This commit is contained in:
parent
7e5c0eb9a5
commit
90c40dbebf
6 changed files with 48 additions and 7 deletions
28
src/text.cpp
28
src/text.cpp
|
@ -24,7 +24,9 @@
|
|||
// USA
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <strings.h>
|
||||
|
@ -142,14 +144,34 @@ void join (
|
|||
const std::string& separator,
|
||||
const std::vector<std::string>& items)
|
||||
{
|
||||
result = "";
|
||||
std::stringstream s;
|
||||
unsigned int size = items.size ();
|
||||
for (unsigned int i = 0; i < size; ++i)
|
||||
{
|
||||
result += items[i];
|
||||
s << items[i];
|
||||
if (i < size - 1)
|
||||
result += separator;
|
||||
s << separator;
|
||||
}
|
||||
|
||||
result = s.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void join (
|
||||
std::string& result,
|
||||
const std::string& separator,
|
||||
const std::vector<int>& items)
|
||||
{
|
||||
std::stringstream s;
|
||||
unsigned int size = items.size ();
|
||||
for (unsigned int i = 0; i < size; ++i)
|
||||
{
|
||||
s << items[i];
|
||||
if (i < size - 1)
|
||||
s << separator;
|
||||
}
|
||||
|
||||
result = s.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue