![]() |
TTMath
0.9.4
C++ bignum library
|
#include <ttmathobjects.h>
Data Structures | |
struct | Item |
Public Types | |
typedef std::map< std::string, Item > | Table |
typedef Table::iterator | Iterator |
typedef Table::const_iterator | CIterator |
Public Member Functions | |
bool | IsDefined (const std::string &name) |
bool | IsDefined (const std::wstring &name) |
ErrorCode | Add (const std::string &name, const std::string &value, int param=0) |
ErrorCode | Add (const std::wstring &name, const std::wstring &value, int param=0) |
bool | Empty () const |
void | Clear () |
CIterator | Begin () const |
CIterator | End () const |
ErrorCode | EditValue (const std::string &name, const std::string &value, int param=0) |
ErrorCode | EditValue (const std::wstring &name, const std::wstring &value, int param=0) |
ErrorCode | EditName (const std::string &old_name, const std::string &new_name) |
ErrorCode | EditName (const std::wstring &old_name, const std::wstring &new_name) |
ErrorCode | Delete (const std::string &name) |
ErrorCode | Delete (const std::wstring &name) |
ErrorCode | GetValue (const std::string &name, std::string &value) const |
ErrorCode | GetValue (const std::wstring &name, std::wstring &value) |
ErrorCode | GetValue (const std::string &name, const char **value) const |
ErrorCode | GetValue (const std::wstring &name, const char **value) |
ErrorCode | GetValueAndParam (const std::string &name, std::string &value, int *param) const |
ErrorCode | GetValueAndParam (const std::wstring &name, std::wstring &value, int *param) |
ErrorCode | GetValueAndParam (const std::string &name, const char **value, int *param) const |
ErrorCode | GetValueAndParam (const std::wstring &name, const char **value, int *param) |
Table * | GetTable () |
Static Public Member Functions | |
static bool | CorrectCharacter (int c, bool can_be_digit) |
template<class string_type > | |
static bool | IsNameCorrect (const string_type &name) |
objects of this class are used with the mathematical parser they hold variables or functions defined by a user
each object has its own table in which we're keeping variables or functions
Definition at line 65 of file ttmathobjects.h.
ErrorCode ttmath::Objects::Add | ( | const std::string & | name, |
const std::string & | value, | ||
int | param = 0 |
||
) |
this method adds one object (variable of function) into the table
Definition at line 175 of file ttmathobjects.h.
References IsNameCorrect().
Referenced by Add(), and EditName().
ErrorCode ttmath::Objects::Add | ( | const std::wstring & | name, |
const std::wstring & | value, | ||
int | param = 0 |
||
) |
this method adds one object (variable of function) into the table
Definition at line 197 of file ttmathobjects.h.
References Add(), ttmath::Misc::AssignString(), and IsNameCorrect().
CIterator ttmath::Objects::Begin | ( | ) | const |
this method returns 'const_iterator' on the first item on the table
Definition at line 234 of file ttmathobjects.h.
void ttmath::Objects::Clear | ( | ) |
this method clears the table
Definition at line 225 of file ttmathobjects.h.
|
static |
this method returns true if a character 'c' is a character which can be in a name
if 'can_be_digit' is true that means when the 'c' is a digit this method returns true otherwise it returns false
Definition at line 102 of file ttmathobjects.h.
Referenced by IsNameCorrect().
ErrorCode ttmath::Objects::Delete | ( | const std::string & | name | ) |
this method deletes an object
Definition at line 349 of file ttmathobjects.h.
References IsNameCorrect().
Referenced by Delete().
ErrorCode ttmath::Objects::Delete | ( | const std::wstring & | name | ) |
this method deletes an object
Definition at line 371 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), Delete(), and IsNameCorrect().
ErrorCode ttmath::Objects::EditName | ( | const std::string & | old_name, |
const std::string & | new_name | ||
) |
this method changes the name of a specific object
Definition at line 295 of file ttmathobjects.h.
References Add(), and IsNameCorrect().
Referenced by EditName().
ErrorCode ttmath::Objects::EditName | ( | const std::wstring & | old_name, |
const std::wstring & | new_name | ||
) |
this method changes the name of a specific object
Definition at line 330 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), EditName(), and IsNameCorrect().
ErrorCode ttmath::Objects::EditValue | ( | const std::string & | name, |
const std::string & | value, | ||
int | param = 0 |
||
) |
this method changes the value and the number of parameters for a specific object
Definition at line 253 of file ttmathobjects.h.
References IsNameCorrect().
Referenced by EditValue().
ErrorCode ttmath::Objects::EditValue | ( | const std::wstring & | name, |
const std::wstring & | value, | ||
int | param = 0 |
||
) |
this method changes the value and the number of parameters for a specific object
Definition at line 276 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), EditValue(), and IsNameCorrect().
bool ttmath::Objects::Empty | ( | ) | const |
this method returns 'true' if the table is empty
Definition at line 216 of file ttmathobjects.h.
CIterator ttmath::Objects::End | ( | ) | const |
this method returns 'const_iterator' pointing at the space after last item (returns table.end())
Definition at line 244 of file ttmathobjects.h.
Table* ttmath::Objects::GetTable | ( | ) |
this method returns a pointer into the table
Definition at line 576 of file ttmathobjects.h.
ErrorCode ttmath::Objects::GetValue | ( | const std::string & | name, |
std::string & | value | ||
) | const |
this method gets the value of a specific object
Definition at line 389 of file ttmathobjects.h.
References IsNameCorrect().
Referenced by GetValue(), and ttmath::Parser< ValueType >::GetValueOfUserDefinedVariable().
ErrorCode ttmath::Objects::GetValue | ( | const std::wstring & | name, |
std::wstring & | value | ||
) |
this method gets the value of a specific object
Definition at line 413 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), GetValue(), and IsNameCorrect().
ErrorCode ttmath::Objects::GetValue | ( | const std::string & | name, |
const char ** | value | ||
) | const |
this method gets the value of a specific object (this version is used for not copying the whole string)
Definition at line 434 of file ttmathobjects.h.
References IsNameCorrect().
ErrorCode ttmath::Objects::GetValue | ( | const std::wstring & | name, |
const char ** | value | ||
) |
this method gets the value of a specific object (this version is used for not copying the whole string)
Definition at line 459 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), GetValue(), and IsNameCorrect().
ErrorCode ttmath::Objects::GetValueAndParam | ( | const std::string & | name, |
std::string & | value, | ||
int * | param | ||
) | const |
this method gets the value and the number of parameters of a specific object
Definition at line 478 of file ttmathobjects.h.
References IsNameCorrect().
Referenced by GetValueAndParam(), and ttmath::Parser< ValueType >::GetValueOfVariable().
ErrorCode ttmath::Objects::GetValueAndParam | ( | const std::wstring & | name, |
std::wstring & | value, | ||
int * | param | ||
) |
this method gets the value and the number of parameters of a specific object
Definition at line 505 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), GetValueAndParam(), and IsNameCorrect().
ErrorCode ttmath::Objects::GetValueAndParam | ( | const std::string & | name, |
const char ** | value, | ||
int * | param | ||
) | const |
this method sets the value and the number of parameters of a specific object (this version is used for not copying the whole string)
Definition at line 527 of file ttmathobjects.h.
References IsNameCorrect().
ErrorCode ttmath::Objects::GetValueAndParam | ( | const std::wstring & | name, |
const char ** | value, | ||
int * | param | ||
) |
this method sets the value and the number of parameters of a specific object (this version is used for not copying the whole string but in fact we make one copying during AssignString())
Definition at line 557 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), GetValueAndParam(), and IsNameCorrect().
bool ttmath::Objects::IsDefined | ( | const std::string & | name | ) |
this method returns true if such an object is defined (name exists)
Definition at line 139 of file ttmathobjects.h.
Referenced by IsDefined().
bool ttmath::Objects::IsDefined | ( | const std::wstring & | name | ) |
this method returns true if such an object is defined (name exists)
Definition at line 157 of file ttmathobjects.h.
References ttmath::Misc::AssignString(), IsDefined(), and IsNameCorrect().
|
static |
this method returns true if the name can be as a name of an object
Definition at line 118 of file ttmathobjects.h.
References CorrectCharacter().
Referenced by Add(), Delete(), EditName(), EditValue(), GetValue(), GetValueAndParam(), and IsDefined().