Biorbd
Public Member Functions | Static Public Member Functions | List of all members
biorbd::utils::String Class Reference

Wrapper around the std::string class with augmented functionality. More...

#include <String.h>

Inheritance diagram for biorbd::utils::String:
biorbd::utils::Equation

Public Member Functions

 String ()
 Construct string.
 
 String (const char *text)
 Construct string. More...
 
 String (const biorbd::utils::String &text)
 Construct string. More...
 
 String (const std::basic_string< char > &text)
 Construct string. More...
 
Stringoperator= (const biorbd::utils::String &other)
 Allow to use operator=. More...
 
String operator+ (unsigned int val)
 Append an unsigned int to the string. More...
 
String operator+ (int val)
 Append an int to the string. More...
 
String operator+ (double val)
 Append a double to the string. More...
 
String operator+ (const char *text)
 Append a char to the string. More...
 
String operator() (unsigned int idx) const
 Get a specific character in the string. More...
 
String operator() (unsigned int startIdx, unsigned int lastIdx) const
 Extract a portion of the string. More...
 
virtual ~String ()
 Destroy class properly.
 
biorbd::utils::String tolower () const
 Return a lower case string. More...
 
biorbd::utils::String toupper () const
 Return an upper case string. More...
 

Static Public Member Functions

static biorbd::utils::String tolower (const biorbd::utils::String &str)
 Convert a string to a lower case string. More...
 
static biorbd::utils::String toupper (const biorbd::utils::String &str)
 Convert a string to a upper case string. More...
 
static biorbd::utils::String to_string (double val)
 Overload of the to_string C++11 function to allow for X-digits precision. More...
 
static biorbd::utils::String to_string (float val)
 Overload of the to_string C++11 function to allow for X-digits precision. More...
 
static biorbd::utils::String removeTrailing (const biorbd::utils::String &origin, const biorbd::utils::String &trailTag)
 The trailing tags of a string. More...
 

Detailed Description

Wrapper around the std::string class with augmented functionality.

Definition at line 15 of file String.h.

Constructor & Destructor Documentation

◆ String() [1/3]

biorbd::utils::String::String ( const char *  text)

Construct string.

Parameters
textThe string in char format

Definition at line 16 of file String.cpp.

◆ String() [2/3]

biorbd::utils::String::String ( const biorbd::utils::String text)

Construct string.

Parameters
textThe string in string format

Definition at line 23 of file String.cpp.

◆ String() [3/3]

biorbd::utils::String::String ( const std::basic_string< char > &  text)

Construct string.

Parameters
textThe string in vector char format

Definition at line 30 of file String.cpp.

Member Function Documentation

◆ operator()() [1/2]

biorbd::utils::String biorbd::utils::String::operator() ( unsigned int  idx) const

Get a specific character in the string.

Parameters
idxThe index of the character

Definition at line 69 of file String.cpp.

◆ operator()() [2/2]

biorbd::utils::String biorbd::utils::String::operator() ( unsigned int  startIdx,
unsigned int  lastIdx 
) const

Extract a portion of the string.

Parameters
startIdxThe index of the first character
lastIdxThe index of the last character

Definition at line 78 of file String.cpp.

◆ operator+() [1/4]

biorbd::utils::String biorbd::utils::String::operator+ ( const char *  text)

Append a char to the string.

Parameters
textThe char to add

Definition at line 47 of file String.cpp.

◆ operator+() [2/4]

biorbd::utils::String biorbd::utils::String::operator+ ( double  val)

Append a double to the string.

Parameters
valThe double to add

Definition at line 54 of file String.cpp.

◆ operator+() [3/4]

biorbd::utils::String biorbd::utils::String::operator+ ( int  val)

Append an int to the string.

Parameters
valThe int to add

Definition at line 64 of file String.cpp.

◆ operator+() [4/4]

biorbd::utils::String biorbd::utils::String::operator+ ( unsigned int  val)

Append an unsigned int to the string.

Parameters
valThe unsinged int to add

Definition at line 59 of file String.cpp.

◆ operator=()

biorbd::utils::String & biorbd::utils::String::operator= ( const biorbd::utils::String other)

Allow to use operator=.

Parameters
otherThe other string

Definition at line 37 of file String.cpp.

◆ removeTrailing()

biorbd::utils::String biorbd::utils::String::removeTrailing ( const biorbd::utils::String origin,
const biorbd::utils::String trailTag 
)
static

The trailing tags of a string.

Parameters
originThe string to remove the trailing tags from
trailTagThe tag to remove
Returns
The string without the trailing tag

Example : The string "2.82823000" will return "2.82823" for the tag "0"

Definition at line 135 of file String.cpp.

◆ to_string() [1/2]

biorbd::utils::String biorbd::utils::String::to_string ( double  val)
static

Overload of the to_string C++11 function to allow for X-digits precision.

Parameters
valThe double to convert
Returns
The double converter to string

Definition at line 117 of file String.cpp.

◆ to_string() [2/2]

biorbd::utils::String biorbd::utils::String::to_string ( float  val)
static

Overload of the to_string C++11 function to allow for X-digits precision.

Parameters
valThe float to convert
Returns
The float converter to string

Definition at line 126 of file String.cpp.

◆ tolower() [1/2]

biorbd::utils::String biorbd::utils::String::tolower ( ) const

Return a lower case string.

Returns
The lower case string

Definition at line 103 of file String.cpp.

◆ tolower() [2/2]

biorbd::utils::String biorbd::utils::String::tolower ( const biorbd::utils::String str)
static

Convert a string to a lower case string.

Parameters
strThe string to convert
Returns
The new string

Definition at line 97 of file String.cpp.

◆ toupper() [1/2]

biorbd::utils::String biorbd::utils::String::toupper ( ) const

Return an upper case string.

Returns
The upper case string

Definition at line 113 of file String.cpp.

◆ toupper() [2/2]

biorbd::utils::String biorbd::utils::String::toupper ( const biorbd::utils::String str)
static

Convert a string to a upper case string.

Parameters
strThe string to convert
Returns
The new string

Definition at line 107 of file String.cpp.


The documentation for this class was generated from the following files: