FEDEM Solver  R8.0
Source code of the dynamics solver
Functions
FFaMathString Namespace Reference

Functions

char * CopyStr (const char *s, int i1=0, int i2=0)
 The string between to indices is returned. More...
 
char * SimplifyStr (char *s)
 Outer bracket of the string is removed. More...
 
char * SupprSpaces (char *s)
 All spaces in a string is removed. More...
 
char * InsStr (const char *s, int n, char c)
 A character is inserted into string in a given position. More...
 
bool EqStr (const char *s1, const char *s2)
 Equality of string one and two is checked. More...
 
bool CompStr (const char *s, int n, const char *s2)
 Searchs a string for another string from given position. More...
 
bool IsNumeric (const char *s)
 Checks if a string is a number. More...
 
int SearchCorOpenbracket (const char *s, int n)
 Searchs a string, from a given position, for a corresponding bracket to '('. More...
 
int SearchCorClosebracket (const char *s, int n)
 Searchs a string, from a given position, for a corresponding bracket to ')'. More...
 
int SearchOperator (const char *s, FFaMathExpr::ROperator op)
 A string is searched for a given operator. More...
 
int GetFunction (const char *s, int n, FFaMathExpr::ROperator &fn)
 Searchs a string for a function from a given position. More...
 
int IsVar (const char *s, int n, int nvar, FFaMathVar **ppvar)
 
int IsPi (const char *s, int n=0)
 Searchs a string for the constant "pi" from a given position. More...
 
int IsFunction (const char *s, int n, int nfunc, FFaMathFunction **ppfunc)
 Searchs a string or a function f(*) for a function from a given position. More...
 
char * IsolateVars (char *s, int nvar, FFaMathVar **ppvar)
 Variables in a string is isolated with brackets. More...
 
char * IsolateNumbers (char *s, int nvar, FFaMathVar **ppvar, int nfunc, FFaMathFunction **ppfunc)
 Isolates numbers in a string or function f(*) with brackets. More...
 

Function Documentation

◆ CompStr()

bool FFaMathString::CompStr ( const char *  s,
int  n,
const char *  s2 
)

Searchs a string for another string from given position.

Parameters
sString to search in
nPosition index
s2String to be found
Returns
true if the string is found from the given position, otherwise false.

◆ CopyStr()

char * FFaMathString::CopyStr ( const char *  s,
int  i1 = 0,
int  i2 = 0 
)

The string between to indices is returned.

Parameters
sString
i1Start index
i2Stopp index
Returns
The string between start index and stop index in a given string

If i1 and i2 are both zero, the whole string is copied.

◆ EqStr()

bool FFaMathString::EqStr ( const char *  s1,
const char *  s2 
)

Equality of string one and two is checked.

Parameters
s1First string
s2Second string
Returns
true if the two strings are equal, otherwise false.

◆ GetFunction()

int FFaMathString::GetFunction ( const char *  s,
int  n,
FFaMathExpr::ROperator fn 
)

Searchs a string for a function from a given position.

Parameters
sString
nPosition index
fnThe function found, or ErrOp if not found
Returns
The length of the function if it is found in given position. 0 if not found.

◆ InsStr()

char * FFaMathString::InsStr ( const char *  s,
int  n,
char  c 
)

A character is inserted into string in a given position.

Parameters
sString
nPosition index
cCharacter to be inserted
Returns
The new string with inserted character

◆ IsFunction()

int FFaMathString::IsFunction ( const char *  s,
int  n,
int  nfunc,
FFaMathFunction **  ppfunc 
)

Searchs a string or a function f(*) for a function from a given position.

Parameters
sString
nPosition index
nfuncFunction index
ppfuncFunction
Returns
The length of the function if it is found from the given position. 0 if not found.

◆ IsNumeric()

bool FFaMathString::IsNumeric ( const char *  s)

Checks if a string is a number.

Parameters
sstring to be evaluated
Returns
true if the string is a number, otherwise false.

◆ IsolateNumbers()

char * FFaMathString::IsolateNumbers ( char *  s,
int  nvar,
FFaMathVar **  ppvar,
int  nfunc,
FFaMathFunction **  ppfunc 
)

Isolates numbers in a string or function f(*) with brackets.

Parameters
sString
nvarVariable index
ppvarVariable
nfuncFunction index
ppfuncFunction
Returns
The string or a function with isolated numbers.

◆ IsolateVars()

char * FFaMathString::IsolateVars ( char *  s,
int  nvar,
FFaMathVar **  ppvar 
)

Variables in a string is isolated with brackets.

Parameters
sString
nvarVariable index
ppvarVariable
Returns
The string with isolated variables

◆ IsPi()

int FFaMathString::IsPi ( const char *  s,
int  n = 0 
)

Searchs a string for the constant "pi" from a given position.

Parameters
sString
nPosition index
Returns
The length (2) of the "pi" if found in given position. 0 if not found.

◆ IsVar()

int FFaMathString::IsVar ( const char *  s,
int  n,
int  nvar,
FFaMathVar **  ppvar 
)

◆ SearchCorClosebracket()

int FFaMathString::SearchCorClosebracket ( const char *  s,
int  n 
)

Searchs a string, from a given position, for a corresponding bracket to ')'.

Parameters
sString
nPosition index
Returns
The position to the corresponding bracket. -1 if not found.

◆ SearchCorOpenbracket()

int FFaMathString::SearchCorOpenbracket ( const char *  s,
int  n 
)

Searchs a string, from a given position, for a corresponding bracket to '('.

Parameters
sString
nPosition index
Returns
The position to the corresponding bracket. -1 if not found.

◆ SearchOperator()

int FFaMathString::SearchOperator ( const char *  s,
FFaMathExpr::ROperator  op 
)

A string is searched for a given operator.

Parameters
sString
opOperator to be found
Returns
The position to the operator. -1 if not found.

◆ SimplifyStr()

char * FFaMathString::SimplifyStr ( char *  s)

Outer bracket of the string is removed.

Parameters
sString
Returns
The string without outer bracket.

◆ SupprSpaces()

char * FFaMathString::SupprSpaces ( char *  s)

All spaces in a string is removed.

Parameters
sString to be modified
Returns
The modified string without spaces.