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
41int main(int argc, char* argv[]) {
42 if (argc != 2) {
43 cerr << FATALERRORL << "run example with exactly one argument: a quotes enclosed list of strings." << endl;
44 return EXIT_FAILURE;
45 }
46 else {
47 string test = argv[1];
48 vector<string> testResult = gutilities::getStringVectorFromString(test);
49
50 cout << " Original String: " << test << endl;
51 cout << " List of items in string: " << endl;
52 for (auto& s : testResult) {
53 cout << SQUAREITEM << s << endl;
54 }
55 }
56
57 return EXIT_SUCCESS;
58}
int main(int argc, char *argv[])
Public API for the gutilities namespace.
Common constants and console-formatting macros used across gutilities and related code.
#define FATALERRORL
Standardized fatal error label prefix (bold red).
#define SQUAREITEM
Square glyph used for list formatting in console logs.
vector< std::string > getStringVectorFromString(const std::string &input)
Splits a string into a vector of strings using whitespace as delimiters.
Definition gutilities.cc:99