Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::utility::cstring Namespace Reference

Functions

uint_fast64_t checked_strtol (char const *str, char const **end)
 Calls strtol() internally and checks if the new pointer is different from the original one, i.e.
 
double checked_strtod (char const *str, char const **end)
 Calls strtod() internally and checks if the new pointer is different from the original one, i.e.
 
char const * skipWord (char const *buf)
 Skips all numbers, letters and special characters.
 
char const * trimWhitespaces (char const *buf)
 Skips spaces, tabs, newlines and carriage returns.
 
char const * forwardToLineEnd (char const *buffer)
 Encapsulates the usage of function @strcspn to forward to the end of the line (next char is the newline character).
 
char const * forwardToNextLine (char const *buffer)
 Encapsulates the usage of function @strchr to forward to the next line.
 

Function Documentation

◆ checked_strtod()

double storm::utility::cstring::checked_strtod ( char const *  str,
char const **  end 
)

Calls strtod() internally and checks if the new pointer is different from the original one, i.e.

Parses floating point and checks, if something has been parsed.

if str != *end. If they are the same, a storm::exceptions::WrongFormatException will be thrown.

Parameters
strString to parse
endNew pointer will be written there
Returns
Result of strtod()

Definition at line 39 of file cstring.cpp.

◆ checked_strtol()

uint_fast64_t storm::utility::cstring::checked_strtol ( char const *  str,
char const **  end 
)

Calls strtol() internally and checks if the new pointer is different from the original one, i.e.

Parses integer and checks, if something has been parsed.

if str != *end. If they are the same, a storm::exceptions::WrongFormatException will be thrown.

Parameters
strString to parse
endNew pointer will be written there
Returns
Result of strtol()

Definition at line 21 of file cstring.cpp.

◆ forwardToLineEnd()

char const * storm::utility::cstring::forwardToLineEnd ( char const *  buffer)

Encapsulates the usage of function @strcspn to forward to the end of the line (next char is the newline character).

Definition at line 74 of file cstring.cpp.

◆ forwardToNextLine()

char const * storm::utility::cstring::forwardToNextLine ( char const *  buffer)

Encapsulates the usage of function @strchr to forward to the next line.

Note: All lines after the current, which do not contain any characters are skipped.

Definition at line 81 of file cstring.cpp.

◆ skipWord()

char const * storm::utility::cstring::skipWord ( char const *  buf)

Skips all numbers, letters and special characters.

Skips all non whitespace characters until the next whitespace.

Returns a pointer to the first char that is a whitespace.

Parameters
bufThe string buffer to operate on.
Returns
A pointer to the first whitespace character.

Definition at line 55 of file cstring.cpp.

◆ trimWhitespaces()

char const * storm::utility::cstring::trimWhitespaces ( char const *  buf)

Skips spaces, tabs, newlines and carriage returns.

Skips common whitespaces in a string.

Returns a pointer to first char that is not a whitespace.

Parameters
bufThe string buffer to operate on.
Returns
A pointer to the first non-whitespace character.

Definition at line 66 of file cstring.cpp.