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

#include <command_manager.h>

Classes

struct  CommandGroup
 
struct  CommandInfo
 

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, CommandGroupcommands_
 

Detailed Description

Definition at line 19 of file command_manager.h.

Member Typedef Documentation

◆ Command

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

Definition at line 24 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 49 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 54 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 61 of file command_manager.h.

References commands_.

◆ ExecuteCommand()

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

Definition at line 67 of file command_manager.h.

References commands_.

◆ ShowWhichKey()

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

Definition at line 14 of file command_manager.cc.

References commands_.

◆ SaveKeybindings()

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

Definition at line 55 of file command_manager.cc.

References commands_.

◆ LoadKeybindings()

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

Definition at line 66 of file command_manager.cc.

References commands_.

Member Data Documentation

◆ commands_

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

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