Geometrize  1.0
An application for geometrizing images into geometric primitives
Public Member Functions | Private Attributes | List of all members
geometrize::script::Command Class Reference

The Command class provides a convenient way for a script to tell an object about something For example, this can be used to give scripts a way to control the Geometrize user interface. More...

#include <command.h>

Public Member Functions

 Command (const std::string &command)
 
virtual ~Command ()=default
 
std::string getCommand () const
 
std::string getStringArg (const std::string &key) const
 
std::string getStringArg (const std::string &key, const std::string &def) const
 
CommandsetStringArg (const std::string &key, const std::string &value)
 

Private Attributes

const std::string m_command
 
std::map< std::string, std::string > m_stringArgs
 

Detailed Description

The Command class provides a convenient way for a script to tell an object about something For example, this can be used to give scripts a way to control the Geometrize user interface.

Constructor & Destructor Documentation

◆ Command()

geometrize::script::Command::Command ( const std::string &  command)
11  : m_command{command}
12 {
13 }

◆ ~Command()

virtual geometrize::script::Command::~Command ( )
virtualdefault

Member Function Documentation

◆ getCommand()

std::string geometrize::script::Command::getCommand ( ) const
16 {
17  return m_command;
18 }
Here is the caller graph for this function:

◆ getStringArg() [1/2]

std::string geometrize::script::Command::getStringArg ( const std::string &  key) const
21 {
22  const auto it = m_stringArgs.find(key);
23  return it == m_stringArgs.end() ? "" : it->second;
24 }
Here is the caller graph for this function:

◆ getStringArg() [2/2]

std::string geometrize::script::Command::getStringArg ( const std::string &  key,
const std::string &  def 
) const
27 {
28  const auto it = m_stringArgs.find(key);
29  return it == m_stringArgs.end() ? def : it->second;
30 }

◆ setStringArg()

Command & geometrize::script::Command::setStringArg ( const std::string &  key,
const std::string &  value 
)
33 {
34  m_stringArgs[key] = value;
35  return *this;
36 }

Member Data Documentation

◆ m_command

const std::string geometrize::script::Command::m_command
private

◆ m_stringArgs

std::map<std::string, std::string> geometrize::script::Command::m_stringArgs
private

The documentation for this class was generated from the following files:
geometrize::script::Command::m_command
const std::string m_command
Definition: command.h:29
geometrize::script::Command::m_stringArgs
std::map< std::string, std::string > m_stringArgs
Definition: command.h:30