guts
Loading...
Searching...
No Matches
string_vector_from_string.cc
Go to the documentation of this file.
1// gutilities
2#include "gutilities.h"
3#include "gutsConventions.h"
4
5// c++
6#include <iostream>
7using namespace std;
8
9
26
41int main(int argc, char* argv[]) {
42 if (argc != 2) {
43 cerr << guts::FATALERRORL << "run example with exactly one argument: a quotes enclosed list of strings."
44 << endl;
45 return EXIT_FAILURE;
46 }
47 else {
48 string test = argv[1];
49 vector<string> testResult = gutilities::getStringVectorFromString(test);
50
51 cout << " Original String: " << test << endl;
52 cout << " List of items in string: " << endl;
53 for (auto& s : testResult) {
54 cout << guts::SQUAREITEM << s << endl;
55 }
56 }
57
58 return EXIT_SUCCESS;
59}
int main(int argc, char *argv[])
Public API for the gutilities namespace.
Serialization, error, and console-formatting constants shared by GEMC modules.
vector< std::string > getStringVectorFromString(const std::string &input)
Splits a string into a vector of strings using whitespace as delimiters.
constexpr char SQUAREITEM[]
constexpr char FATALERRORL[]