low-level parser that extracts but does not interpret ACL options More...

Collaboration diagram for Acl::OptionExtractor:

Public Member Functions

bool extractOne ()
 
const SBufvalue () const
 extracted option value (requires hasValue) More...
 

Public Attributes

SBuf name
 extracted option name, including dash(es) More...
 
bool hasValue = false
 whether the option has a value (-x=value) More...
 

Protected Member Functions

bool advance ()
 extracts a token with the next option/flag(s) or returns false More...
 
void extractWhole ()
 handles -x[=option] or –foo[=option] More...
 
void extractShort ()
 handles one flag letter inside an -xyx[=option] or +xyz[=option] sequence More...
 

Private Attributes

SBuf prefix_
 option name(s), including leading dash(es) More...
 
SBuf value_
 the last seen value of some option More...
 
SBuf::size_type letterPos_ = 0
 letter position inside an -xyz sequence More...
 
bool sawValue_ = false
 the current option sequence had a value More...
 

Detailed Description

Definition at line 21 of file Options.cc.

Member Function Documentation

◆ advance()

bool Acl::OptionExtractor::advance ( )
protected

◆ extractOne()

bool Acl::OptionExtractor::extractOne ( )

parses the next option and fills public members with its details

Returns
whether option extraction was successful

Definition at line 86 of file Options.cc.

References advance(), extractShort(), extractWhole(), SBuf::isEmpty(), SBuf::length(), letterPos_, prefix_, TexcHere, and ToSBuf().

Referenced by Acl::OptionsParser::parse().

◆ extractShort()

void Acl::OptionExtractor::extractShort ( )
protected

◆ extractWhole()

void Acl::OptionExtractor::extractWhole ( )
protected

Definition at line 146 of file Options.cc.

References SBuf::clear(), debugs, hasValue, name, prefix_, and sawValue_.

Referenced by extractOne().

◆ value()

const SBuf & Acl::OptionExtractor::value ( ) const

Definition at line 79 of file Options.cc.

References hasValue, Must, and value_.

Referenced by Acl::OptionsParser::parse().

Member Data Documentation

◆ hasValue

bool Acl::OptionExtractor::hasValue = false

Definition at line 30 of file Options.cc.

Referenced by extractShort(), extractWhole(), Acl::OptionsParser::parse(), and value().

◆ letterPos_

SBuf::size_type Acl::OptionExtractor::letterPos_ = 0
private

Definition at line 41 of file Options.cc.

Referenced by extractOne(), and extractShort().

◆ name

SBuf Acl::OptionExtractor::name

Definition at line 29 of file Options.cc.

Referenced by extractShort(), extractWhole(), and Acl::OptionsParser::parse().

◆ prefix_

SBuf Acl::OptionExtractor::prefix_
private

Definition at line 39 of file Options.cc.

Referenced by advance(), extractOne(), extractShort(), and extractWhole().

◆ sawValue_

bool Acl::OptionExtractor::sawValue_ = false
private

Definition at line 42 of file Options.cc.

Referenced by advance(), extractShort(), and extractWhole().

◆ value_

SBuf Acl::OptionExtractor::value_
private

Definition at line 40 of file Options.cc.

Referenced by advance(), and value().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors