hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
interactive_common_cli.hpp File Reference
#include <algorithm>
#include <ciso646>
#include <iostream>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include <boost/optional.hpp>
Include dependency graph for interactive_common_cli.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  iroha_cli::interactive::ParamData
 

Namespaces

 parser
 
 iroha_cli
 
 iroha_cli::interactive
 

Typedefs

using iroha_cli::interactive::ParamsDescription = std::vector< ParamData >
 
using iroha_cli::interactive::DescriptionMap = std::unordered_map< std::string, std::string >
 
using iroha_cli::interactive::MenuPoints = std::vector< std::string >
 
using iroha_cli::interactive::ParamsMap = std::unordered_map< std::string, ParamsDescription >
 

Enumerations

enum  iroha_cli::interactive::MenuContext { iroha_cli::interactive::MAIN, iroha_cli::interactive::RESULT }
 

Functions

boost::optional< std::string > parser::parseFirstCommand (std::string line)
 
DescriptionMap iroha_cli::interactive::getCommonDescriptionMap ()
 
ParamsMap iroha_cli::interactive::getCommonParamsMap (const std::string &default_ip, int default_port)
 
ParamsDescription iroha_cli::interactive::makeParamsDescription (const std::vector< std::string > &params)
 
void iroha_cli::interactive::handleEmptyCommand ()
 
void iroha_cli::interactive::handleUnknownCommand (std::string &command)
 
void iroha_cli::interactive::addBackOption (MenuPoints &menu)
 
bool iroha_cli::interactive::isBackOption (std::string line)
 
void iroha_cli::interactive::printEnd ()
 
void iroha_cli::interactive::printCommandParameters (std::string &command, const ParamsDescription &parameters)
 
void iroha_cli::interactive::printMenu (const std::string &message, MenuPoints menu_points)
 
boost::optional< std::string > iroha_cli::interactive::promptString (const std::string &message)
 
boost::optional< std::string > iroha_cli::interactive::promptString (const ParamData &param)
 
boost::optional< std::vector< std::string > > iroha_cli::interactive::parseParams (std::string line, std::string command_name, ParamsMap &params_map)
 
size_t iroha_cli::interactive::addMenuPoint (std::vector< std::string > &menu_points, const std::string &description, const std::string &command_short_name)
 
template<typename K , typename V >
std::size_t iroha_cli::interactive::getNextIndex (std::unordered_map< K, V > parsers_map)
 
template<typename K , typename V >
boost::optional< V & > iroha_cli::interactive::findInHandlerMap (K command_name, std::unordered_map< K, V > &params_map)
 
boost::optional< std::pair< std::string, uint16_t > > iroha_cli::interactive::parseIrohaPeerParams (std::vector< std::string > params, const std::string &default_ip, int default_port)
 
template<typename T , typename V , typename C >
boost::optional< T > iroha_cli::interactive::handleParse (C class_pointer, std::string &line, std::unordered_map< std::string, V > &parsers_map, ParamsMap &params_map)
 
template<typename V >
void iroha_cli::interactive::addCliCommand (MenuPoints &menu_points, std::unordered_map< std::string, V > &parsers_map, const std::string &command_name, const std::string &command_description, V parser)
 
template<typename V >
MenuPoints iroha_cli::interactive::formMenu (std::unordered_map< std::string, V > &parsers_map, ParamsMap &paramsMap, const DescriptionMap descriptionMap)
 

Variables

const std::string iroha_cli::interactive::SAVE_CODE = "save"
 
const std::string iroha_cli::interactive::SEND_CODE = "send"
 
const std::string iroha_cli::interactive::BACK_CODE = "b"