ROSE  0.9.10.103
Public Member Functions | List of all members
Sawyer::CommandLine::ExcursionGuard Class Reference

Description

Guards a cursor and restores it when the guard is destroyed.

If the guard is destroyed without first calling its cancel method then the associated cursor's location is reset to its location at the time this guard was constructed.

Definition at line 364 of file util/Sawyer/CommandLine.h.

#include <CommandLine.h>

Public Member Functions

 ExcursionGuard (Cursor &cursor)
 Construct a guard for a cursor. More...
 
void cancel ()
 Cancel the excursion guard. More...
 
const LocationstartingLocation () const
 Starting location. More...
 

Constructor & Destructor Documentation

Sawyer::CommandLine::ExcursionGuard::ExcursionGuard ( Cursor cursor)
inline

Construct a guard for a cursor.

The guard remembers the cursor's location and restores the location if the guard is destroyed before its cancel method is called.

Definition at line 371 of file util/Sawyer/CommandLine.h.

Member Function Documentation

void Sawyer::CommandLine::ExcursionGuard::cancel ( )
inline

Cancel the excursion guard.

The associated cursor will not be reset to its initial location when this guard is destroyed.

Definition at line 376 of file util/Sawyer/CommandLine.h.

const Location& Sawyer::CommandLine::ExcursionGuard::startingLocation ( ) const
inline

Starting location.

This is the location to which the cursor is restored when the guard is destroyed, unless cancel has been called.

Definition at line 380 of file util/Sawyer/CommandLine.h.


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