added: Objects::IsDefined(const std::string & name)

returning true if such an object is defined


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@117 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2009-04-02 05:21:49 +00:00
parent c65857297b
commit fca1bc1a33
4 changed files with 22 additions and 7 deletions

View File

@ -901,7 +901,7 @@ public:
existing first white characters will be ommited
(between '-' and a first digit can be white characters too)
after_source (if exists) is pointing at the end of the parsing string
after_source (if exists) is pointing at the end of the parsed string
value_read (if exists) tells whether something has actually been read (at least one digit)
*/

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2006-2008, Tomasz Sowa
* Copyright (c) 2006-2009, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -130,6 +130,21 @@ public:
}
/*!
this method returns true if such an object is defined (name exists)
*/
bool IsDefined(const std::string & name)
{
Iterator i = table.find(name);
if( i != table.end() )
// we have this object in our table
return true;
return false;
}
/*!
this method adds one object (variable of function) into the table
*/
@ -258,7 +273,7 @@ public:
/*!
this method sets the value of a specific object
this method gets the value of a specific object
*/
ErrorCode GetValue(const std::string & name, std::string & value) const
{
@ -280,7 +295,7 @@ public:
/*!
this method sets the value of a specific object
this method gets the value of a specific object
(this version is used for not copying the whole string)
*/
ErrorCode GetValue(const std::string & name, const char ** value) const
@ -303,7 +318,7 @@ public:
/*!
this method sets the value and the number of parameters
this method gets the value and the number of parameters
of a specific object
*/
ErrorCode GetValueAndParam(const std::string & name, std::string & value, int * param) const

View File

@ -97,7 +97,7 @@ namespace ttmath
etc.
Value can be:
constant e.g. 100, can be preceded by operators to change the base (radix): [#|&]
constant e.g. 100, can be preceded by operators for changing the base (radix): [#|&]
# - hex
& - bin
sample: #10 = 16

View File

@ -3201,7 +3201,7 @@ public:
if the value from s is too large the rest digits will be skipped
after_source (if exists) is pointing at the end of the parsing string
after_source (if exists) is pointing at the end of the parsed string
value_read (if exists) tells whether something has actually been read (at least one digit)
*/