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 )
{
// 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_funcone of xml::init static methods, such as indent_output or remove_whitespace
flagthe 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:
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