0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Tools::client::thriftbroker::CommandInterpreter Class Reference

Command interpreter for ht_thriftbroker. More...

#include <CommandInterpreter.h>

Inheritance diagram for Tools::client::thriftbroker::CommandInterpreter:
Inheritance graph
[legend]
Collaboration diagram for Tools::client::thriftbroker::CommandInterpreter:
Collaboration graph
[legend]

Classes

class  ParseResult
 

Public Member Functions

 CommandInterpreter (Thrift::ClientPtr &client, bool nowait=false)
 Constructor. More...
 
int execute_line (const String &line) override
 
- Public Member Functions inherited from Hypertable::CommandInterpreter
 CommandInterpreter ()
 
void set_timestamp_output_format (const String &format)
 
void set_silent (bool silent)
 
void set_test_mode (bool mode)
 
void set_interactive_mode (bool mode)
 
bool silent_mode ()
 
bool test_mode ()
 
bool normal_mode ()
 
int timestamp_output_format ()
 

Private Member Functions

void parse_line (const String &line, ParseResult &result) const
 Parses a single command. More...
 
void load_help_text ()
 Loads help text. More...
 
void display_help_text (const std::string &command) const
 Displays help text for command. More...
 
void display_usage (const std::string &command) const
 Displays usage for command. More...
 
void parse_error (const std::string &command) const
 

Private Attributes

Thrift::ClientPtr m_client
 File system client. More...
 
std::unordered_map
< std::string, const char ** > 
m_help_text
 Map of help text. More...
 

Additional Inherited Members

- Public Types inherited from Hypertable::CommandInterpreter
enum  { TIMESTAMP_FORMAT_DEFAULT, TIMESTAMP_FORMAT_NANOS }
 
- Protected Attributes inherited from Hypertable::CommandInterpreter
int m_timestamp_output_format
 
bool m_silent
 
bool m_test_mode
 
bool m_interactive
 

Detailed Description

Command interpreter for ht_thriftbroker.

Definition at line 50 of file CommandInterpreter.h.

Constructor & Destructor Documentation

Tools::client::thriftbroker::CommandInterpreter::CommandInterpreter ( Thrift::ClientPtr client,
bool  nowait = false 
)
inline

Constructor.

Initializes m_client with client and #m_nowait with nowait. Also loads help text with a call to load_help_text().

Parameters
clientThriftBroker client
nowaitNo wait flag

Definition at line 59 of file CommandInterpreter.h.

Member Function Documentation

void thriftbroker::CommandInterpreter::display_help_text ( const std::string &  command) const
private

Displays help text for command.

Searches m_help_text for help text for command and displays it if found.

Parameters
commandCommand for which to display help text

Definition at line 219 of file CommandInterpreter.cc.

void thriftbroker::CommandInterpreter::display_usage ( const std::string &  command) const
private

Displays usage for command.

Searches m_help_text for help text for command and displays the first line, which is the command usage.

Parameters
commandCommand for which to display help text

Definition at line 234 of file CommandInterpreter.cc.

int thriftbroker::CommandInterpreter::execute_line ( const String line)
overridevirtual

Implements Hypertable::CommandInterpreter.

Definition at line 65 of file CommandInterpreter.cc.

void thriftbroker::CommandInterpreter::load_help_text ( )
private

Loads help text.

Populates m_help_text with help text for supported commands.

Definition at line 212 of file CommandInterpreter.cc.

void thriftbroker::CommandInterpreter::parse_error ( const std::string &  command) const
private

Definition at line 243 of file CommandInterpreter.cc.

void thriftbroker::CommandInterpreter::parse_line ( const String line,
ParseResult result 
) const
private

Parses a single command.

Parameters
lineString containing command to parse
resultReference to variable to hold parse result

Definition at line 125 of file CommandInterpreter.cc.

Member Data Documentation

Thrift::ClientPtr Tools::client::thriftbroker::CommandInterpreter::m_client
private

File system client.

Definition at line 101 of file CommandInterpreter.h.

std::unordered_map<std::string, const char **> Tools::client::thriftbroker::CommandInterpreter::m_help_text
private

Map of help text.

Definition at line 104 of file CommandInterpreter.h.


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