ROSE 0.11.145.147
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 Sawyer/CommandLine.h.

#include <Sawyer/CommandLine.h>

Public Member Functions

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

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 Sawyer/CommandLine.h.

◆ ~ExcursionGuard()

Sawyer::CommandLine::ExcursionGuard::~ExcursionGuard ( )
inline

Definition at line 375 of file 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 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 Sawyer/CommandLine.h.


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