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

From Apache OpenOffice Wiki
< Uno‎ | Cpp‎ | Spec
Jump to: navigation, search
m (Fixed section indentation.)
(Added example snippet.)
Line 18: Line 18:
 
   void clear(void);
 
   void clear(void);
 
</code>
 
</code>
 +
 +
==Usage Example==
 +
{{:Uno/Cpp/Snippet/Environment Guard}}
  
 
==Dependencies==
 
==Dependencies==

Revision as of 11:30, 28 September 2006

Type: specification State: draft

Feature

A Guard and an AntiGuard for C++ Uno environments.

API

[cpp] cppu/EnvGuards.hxx

cppu::EnvGuard
 EnvGuard(uno::Environment const & env);
cppu::AntiEnvGuard
 AntiEnvGuard(void);
 ClearableEnvGuard
 ClearableEnvGuard(uno::Environment const & env);
 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