From: stephan b. <sg...@us...> - 2004-12-27 23:14:19
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24344/include/pclasses/Util Modified Files: SimplePropertyStore.h Log Message: Removed the get/setBool() variants, as LexT makes them unnecessary :). Index: SimplePropertyStore.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/SimplePropertyStore.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SimplePropertyStore.h 27 Dec 2004 22:51:04 -0000 1.2 +++ SimplePropertyStore.h 27 Dec 2004 23:14:10 -0000 1.3 @@ -65,9 +65,9 @@ /** std::string propval = props["bar"] is functionally - identical to get("bar"). It simply returns an empty - string if key is not found. - + identical to get("bar"). It simply returns a + default-constructed mapped_type entry if key is not + found. */ const mapped_type operator[] ( const key_type & key ) const; @@ -75,6 +75,10 @@ Subtypes which override get() should ensure that their implementation works with this function. To do that they simply must ensure that find(key) will return the same map iterator that get(key) will work with. + + Like std::map, this creates a new, + default-constructed mapped_type entry if key is not + found. */ mapped_type & operator[] ( const key_type & key ); @@ -115,26 +119,10 @@ bool clear(); /** - Note that the set/getTYPE() variants are mostly to - keep old code working. Please use set() and get() - when possible. Sometimes it is more convenient to - use these instead of get()/set(), especially with - something like: - - <pre> - props.set( "foo", false ); // ambiguous: may be bool, const char *, or bool or even int zero :/ - </pre> - - */ - inline void setBool( const key_type & key, bool val ) - { - return this->set( key, val ); - } - - /** - getBool(key) is an exception to the rule: - it returns true if key's value evaluates to true, as - evaluated by the static function boolVal(). + getBool(key) returns true if key's value evaluates + to true, as evaluated by the static function + boolVal(). Like get(), if key is not set it returns + defaultVal. */ bool getBool( const key_type & key, bool defaultVal ) const; |