diff options
-rw-r--r-- | cppu/inc/uno/environment.hxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cppu/inc/uno/environment.hxx b/cppu/inc/uno/environment.hxx index 25b410432769..1b1449931230 100644 --- a/cppu/inc/uno/environment.hxx +++ b/cppu/inc/uno/environment.hxx @@ -4,9 +4,9 @@ * * $RCSfile: environment.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2005-09-08 08:40:49 $ + * last change: $Author: rt $ $Date: 2006-10-27 12:14:57 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -90,6 +90,15 @@ public: */ inline Environment( uno_Environment * pEnv = 0 ) SAL_THROW( () ); + /** Gets a specific environment. If the specified environment does not exist, then a default one + is created and registered. + + @param envTypeName type name of the environment + @param pContext context pointer + */ + inline explicit Environment( rtl::OUString const & envEypeName, void * pContext = NULL ) SAL_THROW( () ); + + /** Copy constructor: acquires given environment @param rEnv another environment @@ -154,6 +163,12 @@ inline Environment::Environment( uno_Environment * pEnv ) SAL_THROW( () ) (*_pEnv->acquire)( _pEnv ); } //__________________________________________________________________________________________________ +inline Environment::Environment( rtl::OUString const & rEnvTypeName, void * pContext ) SAL_THROW( () ) + : _pEnv(NULL) +{ + uno_getEnvironment(&_pEnv, rEnvTypeName.pData, pContext); +} +//__________________________________________________________________________________________________ inline Environment::Environment( const Environment & rEnv ) SAL_THROW( () ) : _pEnv( rEnv._pEnv ) { |