NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::StringExpression Struct Reference

This struct encodes a string expression. It tracks the position of an equal sign in the expression indicating the expression part and its assignee. More...

#include <stringexpression.hpp>

Collaboration diagram for NumeRe::StringExpression:

Public Member Functions

 StringExpression (std::string &_sLine, const std::string &sCache="")
 Constructor of this structure. Searches for the equal sign upon construction. More...
 
bool isAssignmentOperator (size_t eq_pos) const
 This member function determines, whether the equal sign at eq_pos is an assignment operator and no boolean expression. More...
 
void findAssignmentOperator ()
 Searches for the assignment operator (the equal sign separating expression and assignee). If nothing was found, the position is set to 0. If the position was set to 0 in advance, nothing is searched. More...
 
void split ()
 Splits expression and its assignee and sets the assignment operator position to 0. More...
 

Public Attributes

std::string & sLine
 
std::string sAssignee
 
size_t nEqPos
 

Detailed Description

This struct encodes a string expression. It tracks the position of an equal sign in the expression indicating the expression part and its assignee.

Definition at line 34 of file stringexpression.hpp.

Constructor & Destructor Documentation

◆ StringExpression()

NumeRe::StringExpression::StringExpression ( std::string &  _sLine,
const std::string &  sCache = "" 
)
inline

Constructor of this structure. Searches for the equal sign upon construction.

Parameters
_sLinestd::string&
sCacheconst std::string&

Definition at line 49 of file stringexpression.hpp.

References findAssignmentOperator().

Here is the call graph for this function:

Member Function Documentation

◆ findAssignmentOperator()

void NumeRe::StringExpression::findAssignmentOperator ( )
inline

Searches for the assignment operator (the equal sign separating expression and assignee). If nothing was found, the position is set to 0. If the position was set to 0 in advance, nothing is searched.

Returns
void

Definition at line 83 of file stringexpression.hpp.

References getMatchingParenthesis(), isAssignmentOperator(), nEqPos, and sLine.

Referenced by NumeRe::StringParser::eval(), and StringExpression().

Here is the call graph for this function:

◆ isAssignmentOperator()

bool NumeRe::StringExpression::isAssignmentOperator ( size_t  eq_pos) const
inline

This member function determines, whether the equal sign at eq_pos is an assignment operator and no boolean expression.

Parameters
eq_possize_t
Returns
bool

Definition at line 64 of file stringexpression.hpp.

References sLine.

Referenced by findAssignmentOperator().

◆ split()

void NumeRe::StringExpression::split ( )
inline

Splits expression and its assignee and sets the assignment operator position to 0.

Returns
void

Definition at line 125 of file stringexpression.hpp.

References nEqPos, sAssignee, sLine, and StripSpaces().

Referenced by NumeRe::StringParser::eval().

Here is the call graph for this function:

Member Data Documentation

◆ nEqPos

size_t NumeRe::StringExpression::nEqPos

Definition at line 38 of file stringexpression.hpp.

Referenced by NumeRe::StringParser::eval(), findAssignmentOperator(), and split().

◆ sAssignee

std::string NumeRe::StringExpression::sAssignee

Definition at line 37 of file stringexpression.hpp.

Referenced by NumeRe::StringParser::eval(), and split().

◆ sLine

std::string& NumeRe::StringExpression::sLine

The documentation for this struct was generated from the following file: