9 std::vector<std::string> headers,
10 std::vector<int> min_value,
11 std::vector<int> max_value)
13 if (headers.size()-1 != min_value.size() ||
14 headers.size()-1 != max_value.size())
15 throw std::invalid_argument (
"Parameters of unequal length");
17 this->
fields = headers.size();
27 std::fstream file(this->
filename.c_str(), std::ios::out | std::ios::trunc);
30 std::vector <std::string>::iterator str_it;
31 std::vector <int>::iterator int_it;
35 for (i = 0; i < this->
fields; i++)
36 file << this->
headers[i] <<
',';
40 for (i = 0; i < n; i++) {
41 file << this->
type <<
'-' << i <<
',';
42 for (j = 0; j < this->fields-1; j++)
51 return min + (rand() % (max-min+1));
std::vector< int > max_value
int get_random_int(int min, int max)
std::vector< int > min_value
std::vector< std::string > headers
CSVCreator(std::string filename, std::string type, std::vector< std::string > headers, std::vector< int > min_value, std::vector< int > max_value)