gstream-save_input_approver (3) - Linux Manuals

NAME

save_input_approver

SYNOPSIS

#include <gstream.h>

void save_input_approver();

DESCRIPTION

A typical use of the input approver system is to temporarily set a home-made approver, launch an input and then get the original settings back. Consequently there is a pair of functions to help you with that, save_input_approver and restore_input_approver.

Saving will backup the currently used approver, so you can continue using it.

   gs.save_input_approver();
   gs >> my_string;           // uses still default approver
   gs.set_input_approver(ia_my_own);
   gs >> my_string;           // uses ia_my_own approver
   gs.restore_input_approver();
   gs >> my_string;           // uses default approver again