guts
Loading...
Searching...
No Matches
string_vector_from_string.cc File Reference

Example program demonstrating tokenization via gutilities helpers. More...

#include "gutilities.h"
#include "gutsConventions.h"
#include <iostream>
Include dependency graph for string_vector_from_string.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Program entry point.
 

Detailed Description

This example reads a single command-line argument containing a whitespace-separated list of tokens (typically provided in quotes) and prints each token on its own line.

It demonstrates:

  • getStringVectorFromString() to split text on whitespace into individual string tokens.
  • Use of formatting glyphs from gutsConventions.h : (e.g., SQUAREITEM) to keep console output consistent with the rest of the codebase.

Intended audience:

  • Developers wanting a minimal, runnable illustration of how tokenization behaves.

Definition in file string_vector_from_string.cc.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Expected usage:

  • Exactly one argument containing a whitespace-separated list of tokens.

Behavior:

  • If the argument count is incorrect, prints a fatal-style message and returns failure.
  • Otherwise tokenizes the string and prints each resulting token.
Parameters
argcArgument count.
argvArgument vector.
Returns
EXIT_SUCCESS on success, EXIT_FAILURE on incorrect usage.

Definition at line 41 of file string_vector_from_string.cc.