summaryrefslogtreecommitdiff
path: root/comphelper/inc
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-01-15 13:44:08 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-01-15 13:44:08 +0000
commit0c3ca8a883dfdcc0cbbbf8596bf90e3a965fbfa6 (patch)
treea4a08d479b4e8f473436a27e641873880233d27a /comphelper/inc
parentd0b6f28e846cfad30a115ce593003ea7d93c814f (diff)
INTEGRATION: CWS dba22b (1.3.50); FILE MERGED
2006/12/18 11:10:49 fs 1.3.50.3: RESYNC: (1.3-1.4); FILE MERGED 2006/12/09 21:39:39 fs 1.3.50.2: getIfExists_ensureType -> get_ensureType+exception 2006/12/09 21:22:36 fs 1.3.50.1: #i72428# +has
Diffstat (limited to 'comphelper/inc')
-rw-r--r--comphelper/inc/comphelper/namedvaluecollection.hxx42
1 files changed, 29 insertions, 13 deletions
diff --git a/comphelper/inc/comphelper/namedvaluecollection.hxx b/comphelper/inc/comphelper/namedvaluecollection.hxx
index 8566e4aafa57..d98ce696fb16 100644
--- a/comphelper/inc/comphelper/namedvaluecollection.hxx
+++ b/comphelper/inc/comphelper/namedvaluecollection.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: namedvaluecollection.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: rt $ $Date: 2006-12-01 17:32:25 $
+ * last change: $Author: vg $ $Date: 2007-01-15 14:44:08 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -122,22 +122,24 @@ namespace comphelper
value is present, then this parameter will not be touched.
@return
- <TRUE/> if there either is no value with the given name, or there is
- such a value which could be successfully extraced. In the latter case,
- <arg>_out_rValue</arg> will contain the requested value.<br/>
- If there is a value with the given name, but of wrong type, <FALSE/> will
- be returned.
+ <TRUE/> if there is a value with the given name, which could successfully
+ be extraced. In this case, <arg>_out_rValue</arg> will contain the requested
+ value.<br/>
+ <FALSE/>, if there is no value with the given name.
+ @throws IllegalArgumentException
+ in case there is a value with the given name, but it cannot legally assigned to
+ _out_rValue.
*/
template < typename VALUE_TYPE >
- bool getIfExists_ensureType( const sal_Char* _pAsciiValueName, VALUE_TYPE& _out_rValue ) const
+ bool get_ensureType( const sal_Char* _pAsciiValueName, VALUE_TYPE& _out_rValue ) const
{
- return getIfExists_ensureType( ::rtl::OUString::createFromAscii( _pAsciiValueName ), &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
+ return get_ensureType( ::rtl::OUString::createFromAscii( _pAsciiValueName ), &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
}
template < typename VALUE_TYPE >
- bool getIfExists_ensureType( const ::rtl::OUString& _rValueName, VALUE_TYPE& _out_rValue ) const
+ bool get_ensureType( const ::rtl::OUString& _rValueName, VALUE_TYPE& _out_rValue ) const
{
- return getIfExists_ensureType( _rValueName, &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
+ return get_ensureType( _rValueName, &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
}
/** retrieves a value with a given name, or defaults it to a given value, if its not present
@@ -153,7 +155,7 @@ namespace comphelper
VALUE_TYPE getOrDefault( const ::rtl::OUString& _rValueName, const VALUE_TYPE& _rDefault ) const
{
VALUE_TYPE retVal( _rDefault );
- getIfExists_ensureType( _rValueName, retVal );
+ get_ensureType( _rValueName, retVal );
return retVal;
}
@@ -172,12 +174,24 @@ namespace comphelper
return impl_get( _rValueName );
}
+ /// determines whether a value with a given name is present in the collection
+ inline bool has( const sal_Char* _pAsciiValueName ) const
+ {
+ return impl_has( ::rtl::OUString::createFromAscii( _pAsciiValueName ) );
+ }
+
+ /// determines whether a value with a given name is present in the collection
+ inline bool has( const ::rtl::OUString& _rValueName ) const
+ {
+ return impl_has( _rValueName );
+ }
+
private:
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments );
- bool getIfExists_ensureType(
+ bool get_ensureType(
const ::rtl::OUString& _rValueName,
void* _pValueLocation,
const ::com::sun::star::uno::Type& _rExpectedValueType
@@ -185,6 +199,8 @@ namespace comphelper
const ::com::sun::star::uno::Any&
impl_get( const ::rtl::OUString& _rValueName ) const;
+
+ bool impl_has( const ::rtl::OUString& _rValueName ) const;
};
//........................................................................