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.
vector< mrs_string > obsNamesSplit (mrs_string observationNames)
 Helper function for splitting an observation names string used in MarSystems.
vector< mrs_string > stringSplit (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:
observationNames string of observation names (comma separated)
prefix the 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 1996 of file MarSystem.cpp.

Referenced by SpectralFlatnessAllBands::myUpdate(), RunningStatistics::myUpdate(), PowerToAverageRatio::myUpdate(), PitchDiff::myUpdate(), MeanAbsoluteDeviation::myUpdate(), MathPower::myUpdate(), DeltaFirstOrderRegression::myUpdate(), and DelaySamples::myUpdate().

std::vector< mrs_string > obsNamesSplit ( mrs_string  observationNames  ) 

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

Helper function for splitting an observation name string.

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 2066 of file MarSystem.cpp.

References Marsyas::stringSplit().

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

Helper function for splitting a string.

Parameters:
input the string to split.
delimiter the 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 2030 of file MarSystem.cpp.

Referenced by Sum::myUpdate(), Marsyas::obsNamesSplit(), and ArffFileSink::writeArffHeader().


Generated on Wed May 23 00:02:23 2012 for Marsyas by  doxygen 1.5.6