teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Public Types | Public Member Functions | Static Public Member Functions | List of all members
teditor::Option Class Reference

Class to define an option used in the editor. More...

#include <option.h>

Public Types

enum  Type {
  Boolean, Integer, Real, String,
  Char
}
 

Public Member Functions

 Option (const std::string &n, const std::string &v, const std::string &hm, Type t)
 Define a new option. More...
 
bool getBool () const
 
int getInt () const
 
float getReal () const
 
std::string getStr () const
 
char getChar () const
 

Static Public Member Functions

static void add (const std::string &n, const std::string &v, const std::string &hm, Type t)
 Define a new option. More...
 
static void set (const std::string &n, const std::string &val)
 
static Optionget (const std::string &n)
 
static void dumpAll (const std::string &outfile)
 
static void printOpts ()
 

Detailed Description

Class to define an option used in the editor.

Member Enumeration Documentation

◆ Type

All supported option types

Enumerator
Boolean 
Integer 
Real 
String 
Char 

Constructor & Destructor Documentation

◆ Option()

teditor::Option::Option ( const std::string &  n,
const std::string &  v,
const std::string &  hm,
Type  t 
)
inline

Define a new option.

Parameters
nname of the option
vdefault value
hmhelp message for this option
ttype of option

Member Function Documentation

◆ add()

void teditor::Option::add ( const std::string &  n,
const std::string &  v,
const std::string &  hm,
Option::Type  t 
)
static

Define a new option.

Parameters
nname of the option
vdefault value
hmhelp message for this option
ttype of option

◆ dumpAll()

void teditor::Option::dumpAll ( const std::string &  outfile)
static

dumps all options into the rcfile

◆ get()

Option & teditor::Option::get ( const std::string &  n)
static

gets the named option

◆ printOpts()

void teditor::Option::printOpts ( )
static

prints all options to stdout in form of help message

◆ set()

void teditor::Option::set ( const std::string &  n,
const std::string &  val 
)
static

sets value for the given option


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