Marsyas  0.5.0-beta1
Functions
String manipulation

Classes and functions for various string manipulation. More...

Functions

mrs_string obsNamesAddPrefix (mrs_string observationNames, mrs_string prefix)
 Helper function for adding a prefix to each of the observation names.
std::vector< mrs_stringobsNamesSplit (mrs_string observationNames)
 Helper function for splitting an observation names string used in MarSystems.
std::vector< mrs_stringstringSplit (mrs_string input, mrs_string delimiter)
 Helper function for splitting a string.

Detailed Description

Classes and functions for various string manipulation.


Function Documentation

mrs_string obsNamesAddPrefix ( mrs_string  observationNames,
mrs_string  prefix 
)

Helper function for adding a prefix to each of the observation names.

Parameters:
observationNamesstring of observation names (comma separated)
prefixthe prefix the prepend to all the observation names.
Returns:
new comma separated observation name string
Note:
Comma separated observation names in Marsyas use/expect a trailing comma after the last item, this function follows this convention.
Todo:
Use this function in more places (e.g. search for occurrences of 'find(",")').

Definition at line 2344 of file MarSystem.cpp.

vector< mrs_string > obsNamesSplit ( mrs_string  observationNames)

Helper function for splitting an observation names string used in MarSystems.

Parameters:
observationNames,:the observation names string to split.
Returns:
a vector of strings.

Like Marsyas::stringSplit(), but taking the Marsyas convention of a trailing comma into account: the last comma does not produce an empty item. For example, the observation name string "foo,bar," will produce the items "foo" and "bar".

Todo:
Use this function in more places (e.g. search for occurrences of 'find(",")').

Definition at line 2414 of file MarSystem.cpp.

vector< mrs_string > stringSplit ( mrs_string  input,
mrs_string  delimiter 
)

Helper function for splitting a string.

Parameters:
inputthe string to split.
delimiterthe string to split on.
Returns:
a vector of strings.
See also:
Marsyas::obsNamesSplit()
Note:
Comma separated observation names in Marsyas use/expect a trailing comma after the last item. Splitting this string in the traditional way, results in an empty string at the end of the list. Use Marsyas::obsNamesSplit() to avoid this.
Todo:
Use this function in more places (e.g. search for occurrences of 'find(",")').

Definition at line 2378 of file MarSystem.cpp.