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:
Paul Beckingham 2010-07-12 01:42:52 -04:00
parent 7e5c0eb9a5
commit 90c40dbebf
6 changed files with 48 additions and 7 deletions

View file

@ -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 ();
}
////////////////////////////////////////////////////////////////////////////////