GenericContainer
GenericContainer a tool for C++ programming
Loading...
Searching...
No Matches
chap/04_quick.dox File Reference

Functions

void collapse ()
GenericContainer const & write_formatted_data (ostream_type &stream, char const delimiter='\t') const
GenericContainer const & writeFormattedData (ostream_type &stream, char const delimiter='\t') const
GenericContainer & read_formatted_data (istream_type &stream, char const commentChars[]="#%", char const delimiters[]=" \t")
GenericContainer & readFormattedData (istream_type &stream, char const commentChars[]="#%", char const delimiters[]=" \t")
GenericContainer & read_formatted_data (char const fname[], char const commentChars[]="#%", char const delimiters[]=" \t")
GenericContainer & readFormattedData (char const fname[], char const commentChars[]="#%", char const delimiters[]=" \t")
GenericContainer & read_formatted_data2 (istream_type &stream, char const commentChars[]="#%", char const delimiters[]=" \t", GenericContainer ptr_pars[]=nullptr)
GenericContainer & readFormattedData2 (istream_type &stream, char const commentChars[]="#%", char const delimiters[]=" \t", GenericContainer ptr_pars[]=nullptr)
GenericContainer & read_formatted_data2 (char const fname[], char const commentChars[]="#%", char const delimiters[]=" \t", GenericContainer ptr_pars[]=nullptr)
GenericContainer & readFormattedData2 (char const fname[], char const commentChars[]="#%", char const delimiters[]=" \t", GenericContainer ptr_pars[]=nullptr)

Functions

◆ collapse()

void collapse ( )

Collapse heterogeneous vectors into a unified type. Attempts to collapse nested vectors into a matrix when possible.

◆ read_formatted_data() [1/2]

GenericContainer & read_formatted_data ( char const fname[],
char const commentChars[] = "#%",
char const delimiters[] = " \t" )

Read regular formatted data from file fname to GenericContainer.

After successful read GenericContainer will be a map which contains the fields:

  • "headers" a vec_string_type which contains the strings of the headers of the columns of the data
  • "data" a vector_type which contains the vectors which are the columns of the data red of type vec_real_type.
Parameters
fnamefile name to be read
commentCharslines beginning with one of this chars are treated as comments. Default are # and %
delimiterscharacters used as delimiter for headers

◆ read_formatted_data() [2/2]

GenericContainer & read_formatted_data ( istream_type & stream,
char const commentChars[] = "#%",
char const delimiters[] = " \t" )

Read regular formatted data from stream to GenericContainer.

After successful read GenericContainer will be a map which contains the fields:

  • "headers" a vec_string_type which contains the strings of the headers of the columns of the data
  • "data" a vector_type which contains the vectors which are the columns of the data red of type vec_real_type.
Parameters
streamstream to write the output
commentCharslines beginning with one of this chars are treated as comments. Default are # and %
delimiterscharacters used as delimiter for headers

◆ read_formatted_data2() [1/2]

GenericContainer & read_formatted_data2 ( char const fname[],
char const commentChars[] = "#%",
char const delimiters[] = " \t",
GenericContainer ptr_pars[] = nullptr )

Read regular formatted data from file fname to GenericContainer.

After successful read GenericContainer will be a map which contains the fields:

  • "headers" a vec_string_type which contains the strings of the headers of the columns of the data
  • "data" a map_type which contains the vectors which are the columns of the data red of type vec_real_type.
Parameters
fnamefile name to be read
commentCharslines beginning with one of this chars are treated as comments. Default are # and %
delimiterscharacters used as delimiter for headers
ptr_parspointer to a GenericContainer which store the parameter parsed in the comment part of the file

◆ read_formatted_data2() [2/2]

GenericContainer & read_formatted_data2 ( istream_type & stream,
char const commentChars[] = "#%",
char const delimiters[] = " \t",
GenericContainer ptr_pars[] = nullptr )

Read regular formatted data from stream to GenericContainer.

After successful read GenericContainer will be a map which contains the fields:

  • "headers" a vec_string_type which contains the strings of the headers of the columns of the data
  • "data" a map_type which contains the vectors which are the columns of the data red of type vec_real_type.
Parameters
streamstream to write the output
commentCharslines beginning with one of this chars are treated as comments. Default are # and %
delimiterscharacters used as delimiter for headers
ptr_parspointer to a GenericContainer which store poarameter parsed in the comment part of the file

◆ readFormattedData() [1/2]

GenericContainer & readFormattedData ( char const fname[],
char const commentChars[] = "#%",
char const delimiters[] = " \t" )
Deprecated
use read_formatted_data

◆ readFormattedData() [2/2]

GenericContainer & readFormattedData ( istream_type & stream,
char const commentChars[] = "#%",
char const delimiters[] = " \t" )
Deprecated
use read_formatted_data

◆ readFormattedData2() [1/2]

GenericContainer & readFormattedData2 ( char const fname[],
char const commentChars[] = "#%",
char const delimiters[] = " \t",
GenericContainer ptr_pars[] = nullptr )
Deprecated
use read_formatted_data2

◆ readFormattedData2() [2/2]

GenericContainer & readFormattedData2 ( istream_type & stream,
char const commentChars[] = "#%",
char const delimiters[] = " \t",
GenericContainer ptr_pars[] = nullptr )
Deprecated
use read_formatted_data2

◆ write_formatted_data()

GenericContainer const & write_formatted_data ( ostream_type & stream,
char const delimiter = '\t' ) const

Write GenericContainer as regular formatted data to stream.

GenericContainer must be a map which contains the fields:

  • "headers" this element must be a vec_string_type which contains the strings of the headers of the columns of the data
  • "data" this element must be a vector_type which contais the vectors which are the columns of the data to be saved. Each column can be of type

    1. vec_bool_type
    2. vec_int_type
    3. vec_real_type

    all the vector must have the same size.

Parameters
streamstream to write the output
delimiterdesired delimiter (optional). Default is tab.

◆ writeFormattedData()

GenericContainer const & writeFormattedData ( ostream_type & stream,
char const delimiter = '\t' ) const
Deprecated
use write_formatted_data