ROSE  0.11.96.11
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 367 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

◆ ExcursionGuard()

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 374 of file util/Sawyer/CommandLine.h.

Member Function Documentation

◆ cancel()

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 379 of file util/Sawyer/CommandLine.h.

◆ startingLocation()

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 383 of file util/Sawyer/CommandLine.h.


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