ROSE  0.9.9.168
Public Member Functions | Public Attributes | List of all members
Sawyer::CommandLine::Location Struct Reference

Description

Position within a command-line.

A command line consists of an ordered set of strings of various lengths, and this object is an index to a particular character of a particular string.

See also
Cursor::location

Definition at line 213 of file CommandLine.h.

#include <CommandLine.h>

Public Member Functions

 Location ()
 Constructs the location of the first character of the first string. More...
 
 Location (size_t idx, size_t offset)
 Constructs a location that points to a particular character of a particular string. More...
 
bool operator== (const Location &other) const
 Equality. More...
 
bool operator!= (const Location &other) const
 Inequality. More...
 
bool operator< (const Location &other) const
 Less than. More...
 
bool operator<= (const Location &other) const
 Less than or equal. More...
 

Public Attributes

size_t idx
 Index into some vector of program argument strings. More...
 
size_t offset
 Character offset within a program argument string. More...
 

Constructor & Destructor Documentation

Sawyer::CommandLine::Location::Location ( )
inline

Constructs the location of the first character of the first string.

For empty command-lines, this is also the end location.

Definition at line 219 of file CommandLine.h.

Sawyer::CommandLine::Location::Location ( size_t  idx,
size_t  offset 
)
inline

Constructs a location that points to a particular character of a particular string.

Definition at line 222 of file CommandLine.h.

Member Function Documentation

bool Sawyer::CommandLine::Location::operator== ( const Location other) const
inline

Equality.

Returns true only when this location is equal to other. Two locations are equal only when their idx and offset members are equal.

Definition at line 226 of file CommandLine.h.

References idx, and offset.

bool Sawyer::CommandLine::Location::operator!= ( const Location other) const
inline

Inequality.

Returns true only when this location is not equal to other. Two locations are not equal if either their idx or offset members are not equal.

Definition at line 230 of file CommandLine.h.

bool Sawyer::CommandLine::Location::operator< ( const Location other) const
inline

Less than.

Returns true only when this location is less than other. If both locations are referring to the same command-line, then this method returns true if this location points to an earlier character than other.

Definition at line 234 of file CommandLine.h.

References idx, and offset.

bool Sawyer::CommandLine::Location::operator<= ( const Location other) const
inline

Less than or equal.

Returns true only when this location is less than or equal to other as determined by the < or == operators.

Definition at line 238 of file CommandLine.h.

Member Data Documentation

size_t Sawyer::CommandLine::Location::idx
size_t Sawyer::CommandLine::Location::offset

Character offset within a program argument string.

Definition at line 215 of file CommandLine.h.

Referenced by Sawyer::CommandLine::Cursor::atArgBegin(), Sawyer::CommandLine::Cursor::atArgEnd(), Sawyer::CommandLine::Cursor::consumeArgs(), operator<(), and operator==().


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