openMSX
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
openmsx::Completer Class Referenceabstract

#include <Completer.hh>

Inheritance diagram for openmsx::Completer:
Inheritance graph
[legend]

Classes

struct  AtLeast
 
struct  Between
 
struct  Prefix
 

Public Member Functions

const std::string & getName () const
 
virtual std::string help (const std::vector< std::string > &tokens) const =0
 Print help for this command. More...
 
virtual void tabCompletion (std::vector< std::string > &tokens) const =0
 Attempt tab completion for this command. More...
 
virtual InterpretergetInterpreter () const =0
 
void checkNumArgs (span< const TclObject > tokens, unsigned exactly, const char *errMessage) const
 
void checkNumArgs (span< const TclObject > tokens, AtLeast atLeast, const char *errMessage) const
 
void checkNumArgs (span< const TclObject > tokens, Between between, const char *errMessage) const
 
void checkNumArgs (span< const TclObject > tokens, unsigned exactly, Prefix prefix, const char *errMessage) const
 
void checkNumArgs (span< const TclObject > tokens, AtLeast atLeast, Prefix prefix, const char *errMessage) const
 
void checkNumArgs (span< const TclObject > tokens, Between between, Prefix prefix, const char *errMessage) const
 
template<typename ITER >
NEVER_INLINE std::vector< string_viewfilter (string_view str, ITER begin, ITER end, bool caseSensitive)
 

Static Public Member Functions

template<typename ITER >
static void completeString (std::vector< std::string > &tokens, ITER begin, ITER end, bool caseSensitive=true)
 
template<typename RANGE >
static void completeString (std::vector< std::string > &tokens, const RANGE &possibleValues, bool caseSensitive=true)
 
template<typename RANGE >
static void completeFileName (std::vector< std::string > &tokens, const FileContext &context, const RANGE &extra)
 
static void completeFileName (std::vector< std::string > &tokens, const FileContext &context)
 
static std::vector< std::string > formatListInColumns (const std::vector< string_view > &input)
 
static void setOutput (InterpreterOutput *output_)
 

Protected Member Functions

 Completer (string_view name)
 
 ~Completer ()=default
 

Detailed Description

Definition at line 16 of file Completer.hh.

Constructor & Destructor Documentation

◆ Completer()

openmsx::Completer::Completer ( string_view  name)
explicitprotected

◆ ~Completer()

openmsx::Completer::~Completer ( )
protecteddefault

Referenced by setOutput().

Member Function Documentation

◆ checkNumArgs() [1/6]

void openmsx::Completer::checkNumArgs ( span< const TclObject tokens,
unsigned  exactly,
const char *  errMessage 
) const

◆ checkNumArgs() [2/6]

void openmsx::Completer::checkNumArgs ( span< const TclObject tokens,
AtLeast  atLeast,
const char *  errMessage 
) const

Definition at line 185 of file Completer.cc.

References checkNumArgs(), and openmsx::Completer::AtLeast::min.

◆ checkNumArgs() [3/6]

void openmsx::Completer::checkNumArgs ( span< const TclObject tokens,
Between  between,
const char *  errMessage 
) const

Definition at line 190 of file Completer.cc.

References checkNumArgs(), and openmsx::Completer::Between::min.

◆ checkNumArgs() [4/6]

void openmsx::Completer::checkNumArgs ( span< const TclObject tokens,
unsigned  exactly,
Prefix  prefix,
const char *  errMessage 
) const

◆ checkNumArgs() [5/6]

void openmsx::Completer::checkNumArgs ( span< const TclObject tokens,
AtLeast  atLeast,
Prefix  prefix,
const char *  errMessage 
) const

◆ checkNumArgs() [6/6]

void openmsx::Completer::checkNumArgs ( span< const TclObject tokens,
Between  between,
Prefix  prefix,
const char *  errMessage 
) const

◆ completeFileName() [1/2]

template<typename RANGE >
void openmsx::Completer::completeFileName ( std::vector< std::string > &  tokens,
const FileContext context,
const RANGE &  extra 
)
static

◆ completeFileName() [2/2]

void openmsx::Completer::completeFileName ( std::vector< std::string > &  tokens,
const FileContext context 
)
static

◆ completeString() [1/2]

template<typename ITER >
void openmsx::Completer::completeString ( std::vector< std::string > &  tokens,
ITER  begin,
ITER  end,
bool  caseSensitive = true 
)
static

◆ completeString() [2/2]

template<typename RANGE >
void openmsx::Completer::completeString ( std::vector< std::string > &  tokens,
const RANGE &  possibleValues,
bool  caseSensitive = true 
)
static

Definition at line 110 of file Completer.hh.

◆ filter()

template<typename ITER >
NEVER_INLINE std::vector<string_view> openmsx::Completer::filter ( string_view  str,
ITER  begin,
ITER  end,
bool  caseSensitive 
)

Definition at line 90 of file Completer.hh.

References begin(), and end().

◆ formatListInColumns()

vector< string > openmsx::Completer::formatListInColumns ( const std::vector< string_view > &  input)
static

◆ getInterpreter()

virtual Interpreter& openmsx::Completer::getInterpreter ( ) const
pure virtual

Implemented in openmsx::InfoTopic, and openmsx::CommandCompleter.

Referenced by checkNumArgs(), and getName().

◆ getName()

const std::string& openmsx::Completer::getName ( ) const
inline

◆ help()

virtual std::string openmsx::Completer::help ( const std::vector< std::string > &  tokens) const
pure virtual

◆ setOutput()

static void openmsx::Completer::setOutput ( InterpreterOutput output_)
inlinestatic

◆ tabCompletion()

virtual void openmsx::Completer::tabCompletion ( std::vector< std::string > &  tokens) const
pure virtual

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