Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Functions
debugger.cpp File Reference
#include <iostream>
#include <string>
#include <unordered_map>
#include "debugger/debugger.hpp"

Functions

std::vector< std::stringget_string_tokens (std::string input, char delimeter)
 Reads an input string and splits it into a vector of strings by a character delimeter. More...
 
void initialize_commands (std::vector< Command * > &commands)
 Allocate all Command objects recognized by the debugger. More...
 
void free_commands (const std::vector< Command * > &commands)
 Deallocate all Command objects allocated by initialize_commands(). More...
 
void initialize_command_map (std::unordered_map< std::string, Command & > &command_map, const std::vector< Command * > &commands)
 Initialize string (name) -> Command * hashmap maintained by the debugger to all known commands. More...
 

Function Documentation

◆ free_commands()

void free_commands ( const std::vector< Command * > &  commands)

Deallocate all Command objects allocated by initialize_commands().

Parameters
commands

◆ get_string_tokens()

std::vector< std::string > get_string_tokens ( std::string  input,
char  delimeter 
)

Reads an input string and splits it into a vector of strings by a character delimeter.

Parameters
inputString to split into tokens
delimeterDelimiter by which to split string into tokens (no token will contain the delimeter character)
Returns
vector<string> of string tokens

◆ initialize_command_map()

void initialize_command_map ( std::unordered_map< std::string, Command & > &  command_map,
const std::vector< Command * > &  commands 
)

Initialize string (name) -> Command * hashmap maintained by the debugger to all known commands.

Parameters
command_mapReference to the debugger's command map (assumed empty).

◆ initialize_commands()

void initialize_commands ( std::vector< Command * > &  commands)

Allocate all Command objects recognized by the debugger.

Parameters
commands