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

 Completer (const Completer &)=delete
 
 Completer (Completer &&)=delete
 
Completeroperator= (const Completer &)=delete
 
Completeroperator= (Completer &&)=delete
 
const std::string & getName () const
 
virtual std::string help (std::span< const TclObject > tokens) const =0
 Print help for this command.
 
virtual void tabCompletion (std::vector< std::string > &tokens) const =0
 Attempt tab completion for this command.
 
virtual InterpretergetInterpreter () const =0
 
void checkNumArgs (std::span< const TclObject > tokens, unsigned exactly, const char *errMessage) const
 
void checkNumArgs (std::span< const TclObject > tokens, AtLeast atLeast, const char *errMessage) const
 
void checkNumArgs (std::span< const TclObject > tokens, Between between, const char *errMessage) const
 
void checkNumArgs (std::span< const TclObject > tokens, unsigned exactly, Prefix prefix, const char *errMessage) const
 
void checkNumArgs (std::span< const TclObject > tokens, AtLeast atLeast, Prefix prefix, const char *errMessage) const
 
void checkNumArgs (std::span< const TclObject > tokens, Between between, Prefix prefix, const char *errMessage) const
 
template<typename ITER >
NEVER_INLINE std::vector< std::string_view > filter (std::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, 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 (std::span< const std::string_view > input)
 
static void setOutput (InterpreterOutput *output_)
 

Protected Member Functions

template<typename String >
requires (!std::same_as<Completer, std::remove_cvref_t<String>>)
 Completer (String &&name_)
 
 ~Completer ()=default
 

Detailed Description

Definition at line 19 of file Completer.hh.

Constructor & Destructor Documentation

◆ Completer() [1/3]

openmsx::Completer::Completer ( const Completer )
delete

◆ Completer() [2/3]

openmsx::Completer::Completer ( Completer &&  )
delete

◆ Completer() [3/3]

template<typename String >
requires (!std::same_as<Completer, std::remove_cvref_t<String>>)
openmsx::Completer::Completer ( String &&  name_)
inlineexplicitprotected

Definition at line 77 of file Completer.hh.

◆ ~Completer()

openmsx::Completer::~Completer ( )
protecteddefault

Member Function Documentation

◆ checkNumArgs() [1/6]

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

Definition at line 186 of file Completer.cc.

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

◆ checkNumArgs() [2/6]

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

◆ checkNumArgs() [3/6]

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

Definition at line 191 of file Completer.cc.

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

◆ checkNumArgs() [4/6]

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

◆ checkNumArgs() [5/6]

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

◆ checkNumArgs() [6/6]

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

◆ completeFileName() [1/2]

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

Definition at line 130 of file Completer.cc.

◆ completeFileName() [2/2]

template<typename RANGE >
void openmsx::Completer::completeFileName ( std::vector< std::string > &  tokens,
const FileContext context,
const RANGE &  extra 
)
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,
RANGE &&  possibleValues,
bool  caseSensitive = true 
)
static

Definition at line 124 of file Completer.hh.

◆ filter()

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

Definition at line 104 of file Completer.hh.

References begin(), and end().

◆ formatListInColumns()

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

Definition at line 59 of file Completer.cc.

References openmsx::InterpreterOutput::getOutputColumns().

◆ getInterpreter()

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

◆ getName()

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

◆ help()

virtual std::string openmsx::Completer::help ( std::span< const TclObject tokens) const
pure virtual

◆ operator=() [1/2]

Completer & openmsx::Completer::operator= ( Completer &&  )
delete

◆ operator=() [2/2]

Completer & openmsx::Completer::operator= ( const Completer )
delete

◆ setOutput()

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

Definition at line 72 of file Completer.hh.

Referenced by openmsx::ImGuiConsole::ImGuiConsole().

◆ 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: