JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Member Functions | Protected Member Functions | Protected Attributes
joda::cli::CLI Class Reference

#include <CLI.h>

Collaboration diagram for joda::cli::CLI:
[legend]

Public Member Functions

 CLI ()
 
void start (const std::vector< std::string > &onceQueries)
 
void setSimpleMode (bool simpleMode)
 

Protected Member Functions

void checkTerminal ()
 
std::string & ltrim (std::string &str)
 
std::string & rtrim (std::string &str)
 
void parseCommand ()
 
void print (const std::string &toprint)
 
std::vector< std::pair< std::string, std::function< void(const std::string &)> > > getCommands ()
 
void quit ()
 
void query (std::string &query)
 
void toggleCache ()
 
void help ()
 
void dumpConfig ()
 
void listSources ()
 
void listResults ()
 
void unknownCommand ()
 
void executeQuery (std::shared_ptr< query::Query > &query, bool printResult=true)
 
void executeNonInteractiveQuery (std::shared_ptr< query::Query > &query, bool printResult=true)
 
void logo ()
 
void benchmarkQuery (const std::shared_ptr< query::Query > &q, const std::string &name)
 
void benchmarkQuery (std::vector< std::shared_ptr< query::Query >> qs, const std::string &name)
 
std::shared_ptr< JSONStoragecheckResult (unsigned long resultId)
 

Protected Attributes

bool simpleMode = false
 
bool execute = true
 
Benchmark bench
 

Detailed Description

This class is responsible for the main CLI loop

Constructor & Destructor Documentation

◆ CLI()

joda::cli::CLI::CLI ( )
Here is the call graph for this function:

Member Function Documentation

◆ benchmarkQuery() [1/2]

void joda::cli::CLI::benchmarkQuery ( const std::shared_ptr< query::Query > &  q,
const std::string &  name 
)
protected
Here is the call graph for this function:

◆ benchmarkQuery() [2/2]

void joda::cli::CLI::benchmarkQuery ( std::vector< std::shared_ptr< query::Query >>  qs,
const std::string &  name 
)
protected

◆ checkResult()

std::shared_ptr< JSONStorage > joda::cli::CLI::checkResult ( unsigned long  resultId)
protected
Here is the call graph for this function:

◆ checkTerminal()

void joda::cli::CLI::checkTerminal ( )
protected
Here is the caller graph for this function:

◆ dumpConfig()

void joda::cli::CLI::dumpConfig ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeNonInteractiveQuery()

void joda::cli::CLI::executeNonInteractiveQuery ( std::shared_ptr< query::Query > &  query,
bool  printResult = true 
)
protected
Here is the call graph for this function:

◆ executeQuery()

void joda::cli::CLI::executeQuery ( std::shared_ptr< query::Query > &  query,
bool  printResult = true 
)
protected
Here is the call graph for this function:

◆ getCommands()

std::vector< std::pair< std::string, std::function< void(const std::string &)> > > joda::cli::CLI::getCommands ( )
protected
Here is the call graph for this function:

◆ help()

void joda::cli::CLI::help ( )
protected
Here is the caller graph for this function:

◆ listResults()

void joda::cli::CLI::listResults ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ listSources()

void joda::cli::CLI::listSources ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ logo()

void joda::cli::CLI::logo ( )
protected
Here is the caller graph for this function:

◆ ltrim()

std::string & joda::cli::CLI::ltrim ( std::string &  str)
protected

◆ parseCommand()

void joda::cli::CLI::parseCommand ( )
protected

◆ print()

void joda::cli::CLI::print ( const std::string &  toprint)
protected

◆ query()

void joda::cli::CLI::query ( std::string &  query)
protected
Here is the call graph for this function:

◆ quit()

void joda::cli::CLI::quit ( )
protected
Here is the caller graph for this function:

◆ rtrim()

std::string & joda::cli::CLI::rtrim ( std::string &  str)
protected

◆ setSimpleMode()

void joda::cli::CLI::setSimpleMode ( bool  simpleMode)

Changes interactivity of the CLI. In interactive mode, the program will use ncurses to show query progress and display result documents. In noninteractive mode only three sample documents will be shown in the CLI.

Parameters
simpleModeIf true, the CLI will be interactive, if false not

◆ start()

void joda::cli::CLI::start ( const std::vector< std::string > &  onceQueries)

Starts the CLI and reacts to user-input

Parameters
onceQueriesOptional queries to be executed once with a following shutdown of the system
Here is the call graph for this function:

◆ toggleCache()

void joda::cli::CLI::toggleCache ( )
protected
Here is the caller graph for this function:

◆ unknownCommand()

void joda::cli::CLI::unknownCommand ( )
protected

Field Documentation

◆ bench

Benchmark joda::cli::CLI::bench
protected

◆ execute

bool joda::cli::CLI::execute = true
protected

◆ simpleMode

bool joda::cli::CLI::simpleMode = false
protected

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