Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
Shell Class Reference

#include <cadabra2-cli.hh>

Inheritance diagram for Shell:

Classes

class  CatchOutput

Public Types

enum class  Flags : unsigned int {
  None = 0x00 , NoBanner = 0x01 , IgnoreSemicolons = 0x02 , NoColour = 0x04 ,
  NoReadline = 0x08 , TeXmacs = 0x10
}

Public Member Functions

 Shell (Flags flags)
 ~Shell ()
void start ()
void interact ()
void interact_texmacs ()
pybind11::object evaluate (const std::string &code, const std::string &filename="<stdin>") const
void execute (const std::string &code, const std::string &filename="<stdin>")
void execute_file (const std::string &filename, bool preprocess=true)
void interact_file (const std::string &filename, bool preprocess=true)
void show_banner () const
void write_stdout (const std::string &text, const std::string &end="\n", bool flush=false)
void write_stderr (const std::string &text, const std::string &end="\n", bool flush=false)

Public Attributes

CatchOutput catchOut
CatchOutput catchErr

Private Member Functions

void set_histfile ()
std::string str (const pybind11::handle &obj) const
std::string repr (const pybind11::handle &obj)
std::string sanitize (std::string s)
void process_ps1 (const std::string &line)
void process_ps2 (const std::string &line)
void set_completion_callback (const char *buffer, std::vector< std::string > &completions)
std::string get_ps1 ()
std::string get_ps2 ()
void handle_error ()
void handle_error (pybind11::error_already_set &err)
void open_texmacs_logfile ()

Private Attributes

std::string histfile
std::string site_path
std::ofstream logf
pybind11::module main_module
pybind11::object main_namespace
pybind11::dict globals
pybind11::object sys
pybind11::object py_stdout
pybind11::object py_stderr
std::string collect
const char * colour_error
const char * colour_warning
const char * colour_info
const char * colour_success
const char * colour_reset
const char * colour_bold
Flags flags

Member Enumeration Documentation

◆ Flags

enum class Shell::Flags : unsigned int
strong
Enumerator
None 
NoBanner 
IgnoreSemicolons 
NoColour 
NoReadline 
TeXmacs 

Constructor & Destructor Documentation

◆ Shell()

Shell::Shell ( Flags flags)

◆ ~Shell()

Shell::~Shell ( )

Member Function Documentation

◆ evaluate()

pybind11::object Shell::evaluate ( const std::string & code,
const std::string & filename = "<stdin>" ) const

◆ execute()

void Shell::execute ( const std::string & code,
const std::string & filename = "<stdin>" )

◆ execute_file()

void Shell::execute_file ( const std::string & filename,
bool preprocess = true )

◆ get_ps1()

std::string Shell::get_ps1 ( )
private

◆ get_ps2()

std::string Shell::get_ps2 ( )
private

◆ handle_error() [1/2]

void Shell::handle_error ( )
private

◆ handle_error() [2/2]

void Shell::handle_error ( pybind11::error_already_set & err)
private

◆ interact()

void Shell::interact ( )

◆ interact_file()

void Shell::interact_file ( const std::string & filename,
bool preprocess = true )

◆ interact_texmacs()

void Shell::interact_texmacs ( )

◆ open_texmacs_logfile()

void Shell::open_texmacs_logfile ( )
private

◆ process_ps1()

void Shell::process_ps1 ( const std::string & line)
private

◆ process_ps2()

void Shell::process_ps2 ( const std::string & line)
private

◆ repr()

std::string Shell::repr ( const pybind11::handle & obj)
private

◆ sanitize()

std::string Shell::sanitize ( std::string s)
private

◆ set_completion_callback()

void Shell::set_completion_callback ( const char * buffer,
std::vector< std::string > & completions )
private

◆ set_histfile()

void Shell::set_histfile ( )
private

◆ show_banner()

void Shell::show_banner ( ) const

◆ start()

void Shell::start ( )

◆ str()

std::string Shell::str ( const pybind11::handle & obj) const
private

◆ write_stderr()

void Shell::write_stderr ( const std::string & text,
const std::string & end = "\n",
bool flush = false )

◆ write_stdout()

void Shell::write_stdout ( const std::string & text,
const std::string & end = "\n",
bool flush = false )

Member Data Documentation

◆ catchErr

CatchOutput Shell::catchErr

◆ catchOut

CatchOutput Shell::catchOut

◆ collect

std::string Shell::collect
private

◆ colour_bold

const char* Shell::colour_bold
private

◆ colour_error

const char* Shell::colour_error
private

◆ colour_info

const char* Shell::colour_info
private

◆ colour_reset

const char* Shell::colour_reset
private

◆ colour_success

const char* Shell::colour_success
private

◆ colour_warning

const char* Shell::colour_warning
private

◆ flags

Flags Shell::flags
private

◆ globals

pybind11::dict Shell::globals
private

◆ histfile

std::string Shell::histfile
private

◆ logf

std::ofstream Shell::logf
private

◆ main_module

pybind11::module Shell::main_module
private

◆ main_namespace

pybind11::object Shell::main_namespace
private

◆ py_stderr

pybind11::object Shell::py_stderr
private

◆ py_stdout

pybind11::object Shell::py_stdout
private

◆ site_path

std::string Shell::site_path
private

◆ sys

pybind11::object Shell::sys
private

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