Difference between revisions of "Uno/Cpp/Spec/Environment Guard"

From Apache OpenOffice Wiki
< Uno‎ | Cpp‎ | Spec
Jump to: navigation, search
(Added example snippet.)
(Fixed API.)
Line 2: Line 2:
  
 
==Feature==
 
==Feature==
A Guard and an AntiGuard for [[Uno/Cpp/Spec/Environment|C++ Uno environments]].
+
A Guard for [[Uno/Cpp/Spec/Environment|C++ Uno environments]].
  
 
==API==
 
==API==
Line 8: Line 8:
 
cppu/EnvGuards.hxx
 
cppu/EnvGuards.hxx
  
cppu::EnvGuard
+
  class cppu::EnvGuard
   EnvGuard(uno::Environment const & env);
+
   {
 +
    public:
 +
      EnvGuard(cssuno::Environment const & env);
 +
      ~EnvGuard(void);
  
cppu::AntiEnvGuard
+
      void clear(void);
  AntiEnvGuard(void);
+
   };
 
+
   ClearableEnvGuard
+
  ClearableEnvGuard(uno::Environment const & env);
+
  void clear(void);
+
 
</code>
 
</code>
  

Revision as of 15:03, 29 September 2006

Type: specification State: draft

Feature

A Guard for C++ Uno environments.

API

[cpp] cppu/EnvGuards.hxx

 class cppu::EnvGuard
 {
   public:
     EnvGuard(cssuno::Environment const & env);
     ~EnvGuard(void);
     void clear(void);
 };

Usage Example

#include <cppu/EnvGuards.hxx>
...
{
  cppu::EnvGuard cppUnsafe(uno::Environment(RTL_CONSTASCII_USTRINGPARAM("c++:unsafe")));
  // From here onwards the environment is entered, until the end of the block.
  ...
}

Dependencies

Personal tools