Bsoft  2.1.0
Bernard's software package
string_util.cpp File Reference
#include "string_util.h"
#include "utilities.h"

Go to the source code of this file.

Functions

string command_line (int argc, char **argv)
 
string base (string &filename)
 
string extension (string filename)
 
string replace_extension (string &filename, string ext)
 
string insert (string &filename, string ins)
 
string parameter_file_path (string &filename)
 Finds the parameter file path. More...
 
vector< string > split (const string &s)
 Splits a string on whitespace. More...
 
vector< string > split (const string &s, char delim)
 Splits a string using a given delimiter. More...
 
vector< long > parse_integer_vector (string vecstr)
 
vector< double > parse_real_vector (string vecstr)
 
string local_time ()
 

Variables

int verbose
 

Detailed Description

Author
Bernard Heymann
Date
20160911 - 20180330

Definition in file string_util.cpp.

Function Documentation

◆ base()

string base ( string &  filename)

Definition at line 28 of file string_util.cpp.

◆ command_line()

string command_line ( int  argc,
char **  argv 
)

Definition at line 16 of file string_util.cpp.

◆ extension()

string extension ( string  filename)

Definition at line 32 of file string_util.cpp.

◆ insert()

string insert ( string &  filename,
string  ins 
)

Definition at line 48 of file string_util.cpp.

◆ local_time()

string local_time ( )

Definition at line 143 of file string_util.cpp.

◆ parameter_file_path()

string parameter_file_path ( string &  filename)

Finds the parameter file path.

Parameters
&filenamethe parameter filename.
Returns
Bstring the full path and file name.
The parameter file path should primarily be defined in the environmental
variable "BPARAM".
Otherwise a default is used which may or may not be valid.
The string returned has a length containing the path plus one byte.

Definition at line 69 of file string_util.cpp.

◆ parse_integer_vector()

vector<long> parse_integer_vector ( string  vecstr)

Definition at line 119 of file string_util.cpp.

◆ parse_real_vector()

vector<double> parse_real_vector ( string  vecstr)

Definition at line 131 of file string_util.cpp.

◆ replace_extension()

string replace_extension ( string &  filename,
string  ext 
)

Definition at line 41 of file string_util.cpp.

◆ split() [1/2]

vector<string> split ( const string &  s)

Splits a string on whitespace.

Parameters
&sstring to be split.
Returns
vector<string> vector of strings.

Definition at line 92 of file string_util.cpp.

◆ split() [2/2]

vector<string> split ( const string &  s,
char  delim 
)

Splits a string using a given delimiter.

Parameters
&sstring to be split.
delimdelimiter.
Returns
vector<string> vector of strings.

Definition at line 106 of file string_util.cpp.

Variable Documentation

◆ verbose

int verbose
extern