xmlwrapp Lightweight C++ XML parsing library

Public Member Functions | List of all members
xml::init::change_flag Class Reference

RAII helper changing some global XML library flag only for the duration of its lifetime. More...

`#include <init.h>`

## Public Member Functions
| change_flag (change_func_t change_func, bool flag)
| Constructor changes the flag using the specified function. More...
| ~change_flag ()
| Destructor restores the original flag value. More...

## Detailed Description

RAII helper changing some global XML library flag only for the duration of its lifetime.

Example use:

void some_function()
{
if ( whatever )
{
xml::init::change_flag change(&xml::init::substitute_entities, false);
// entities are not substituted here
}
// entities substitution flag reverted to its original value here
}

Since
  0.9.1

## Constructor & Destructor Documentation

## ◆ change_flag()

xml::init::change_flag::change_flag | ( | change_func_t | change_func,
|  | bool | flag
| ) |  |
| inline

Constructor changes the flag using the specified function.

The same function will be called from this object destructor to restore the flag value.

Parameters

  change_func | one of xml::init static methods, such as indent_output or remove_whitespace
  flag | the value of the flag to use

## ◆ ~change_flag()

xml::init::change_flag::~change_flag | ( |  | ) |
| inline

Destructor restores the original flag value.

The documentation for this class was generated from the following file:

- xmlwrapp/init.h

xml::init::substitute_entities
static bool substitute_entities(bool flag)
This member function controls whether or not the XML parser should substitute entities while parsing.
xml::init::change_flag
RAII helper changing some global XML library flag only for the duration of its lifetime.
Definition: init.h:91