The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
events::cmd_arg_parser Class Reference

#include <map_command_handler.hpp>

Public Member Functions

 cmd_arg_parser ()
 
 cmd_arg_parser (const std::string &str)
 
void parse (const std::string &str)
 
const std::string & get_str () const
 
std::string get_arg (unsigned n) const
 
std::string get_data (unsigned n) const
 
std::string get_cmd () const
 

Private Member Functions

cmd_arg_parseroperator= (const cmd_arg_parser &)
 
 cmd_arg_parser (const cmd_arg_parser &)
 
void advance_to_arg (unsigned n) const
 

Private Attributes

std::string str_
 
std::vector< std::size_t > args
 
bool args_end
 

Detailed Description

Definition at line 32 of file map_command_handler.hpp.

Constructor & Destructor Documentation

◆ cmd_arg_parser() [1/3]

events::cmd_arg_parser::cmd_arg_parser ( )
inline

Definition at line 35 of file map_command_handler.hpp.

◆ cmd_arg_parser() [2/3]

events::cmd_arg_parser::cmd_arg_parser ( const std::string &  str)
inlineexplicit

Definition at line 42 of file map_command_handler.hpp.

◆ cmd_arg_parser() [3/3]

events::cmd_arg_parser::cmd_arg_parser ( const cmd_arg_parser )
private

Member Function Documentation

◆ advance_to_arg()

void events::cmd_arg_parser::advance_to_arg ( unsigned  n) const
inlineprivate

Definition at line 90 of file map_command_handler.hpp.

References args, args_end, n, and str_.

Referenced by get_arg(), and get_data().

◆ get_arg()

std::string events::cmd_arg_parser::get_arg ( unsigned  n) const
inline

Definition at line 61 of file map_command_handler.hpp.

References advance_to_arg(), args, n, and str_.

Referenced by events::map_command_handler< Worker >::get_arg(), and get_cmd().

◆ get_cmd()

std::string events::cmd_arg_parser::get_cmd ( ) const
inline

Definition at line 83 of file map_command_handler.hpp.

References get_arg().

Referenced by events::map_command_handler< Worker >::get_cmd().

◆ get_data()

std::string events::cmd_arg_parser::get_data ( unsigned  n) const
inline

◆ get_str()

const std::string& events::cmd_arg_parser::get_str ( ) const
inline

Definition at line 57 of file map_command_handler.hpp.

References str_.

◆ operator=()

cmd_arg_parser& events::cmd_arg_parser::operator= ( const cmd_arg_parser )
private

◆ parse()

void events::cmd_arg_parser::parse ( const std::string &  str)
inline

Definition at line 49 of file map_command_handler.hpp.

References args, args_end, and str_.

Referenced by events::map_command_handler< Worker >::parse_cmd().

Member Data Documentation

◆ args

std::vector<std::size_t> events::cmd_arg_parser::args
mutableprivate

Definition at line 104 of file map_command_handler.hpp.

Referenced by advance_to_arg(), get_arg(), get_data(), and parse().

◆ args_end

bool events::cmd_arg_parser::args_end
mutableprivate

Definition at line 105 of file map_command_handler.hpp.

Referenced by advance_to_arg(), and parse().

◆ str_

std::string events::cmd_arg_parser::str_
private

Definition at line 103 of file map_command_handler.hpp.

Referenced by advance_to_arg(), get_arg(), get_data(), get_str(), and parse().


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