yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::CommandManager Class Reference

#include <command_manager.h>

Classes

struct  CommandInfo
 
struct  CommandInfoOrPrefix
 

Public Types

using Command = std::function<void()>
 

Public Member Functions

 CommandManager ()=default
 
 ~CommandManager ()=default
 
void RegisterPrefix (const std::string &group_name, const char prefix, const std::string &name, const std::string &desc)
 
void RegisterSubcommand (const std::string &group_name, const std::string &shortcut, const char mnemonic, const std::string &name, const std::string &desc, Command command)
 
void RegisterCommand (const std::string &shortcut, Command command, char mnemonic, const std::string &name, const std::string &desc)
 
void ExecuteCommand (const std::string &shortcut)
 
void ShowWhichKey ()
 
void SaveKeybindings (const std::string &filepath)
 
void LoadKeybindings (const std::string &filepath)
 

Private Attributes

std::unordered_map< std::string, CommandInfoOrPrefixcommands_
 

Detailed Description

Definition at line 15 of file command_manager.h.

Member Typedef Documentation

◆ Command

using yaze::editor::CommandManager::Command = std::function<void()>

Definition at line 20 of file command_manager.h.

Constructor & Destructor Documentation

◆ CommandManager()

yaze::editor::CommandManager::CommandManager ( )
default

◆ ~CommandManager()

yaze::editor::CommandManager::~CommandManager ( )
default

Member Function Documentation

◆ RegisterPrefix()

void yaze::editor::CommandManager::RegisterPrefix ( const std::string & group_name,
const char prefix,
const std::string & name,
const std::string & desc )
inline

Definition at line 45 of file command_manager.h.

References commands_.

◆ RegisterSubcommand()

void yaze::editor::CommandManager::RegisterSubcommand ( const std::string & group_name,
const std::string & shortcut,
const char mnemonic,
const std::string & name,
const std::string & desc,
Command command )
inline

Definition at line 50 of file command_manager.h.

References commands_.

◆ RegisterCommand()

void yaze::editor::CommandManager::RegisterCommand ( const std::string & shortcut,
Command command,
char mnemonic,
const std::string & name,
const std::string & desc )
inline

Definition at line 58 of file command_manager.h.

References commands_.

◆ ExecuteCommand()

void yaze::editor::CommandManager::ExecuteCommand ( const std::string & shortcut)
inline

Definition at line 65 of file command_manager.h.

References commands_.

◆ ShowWhichKey()

void yaze::editor::CommandManager::ShowWhichKey ( )

Definition at line 75 of file command_manager.cc.

References commands_.

◆ SaveKeybindings()

void yaze::editor::CommandManager::SaveKeybindings ( const std::string & filepath)

Definition at line 116 of file command_manager.cc.

References commands_.

◆ LoadKeybindings()

void yaze::editor::CommandManager::LoadKeybindings ( const std::string & filepath)

Definition at line 127 of file command_manager.cc.

References commands_.

Member Data Documentation

◆ commands_

std::unordered_map<std::string, CommandInfoOrPrefix> yaze::editor::CommandManager::commands_
private

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