Elaztek Developer Hub
Blamite Game Engine - blam!  00346.12.11.21.0529.blamite
The core library for the Blamite Game Engine.
explore.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../console.h"
4 
5 #include <set>
6 #include <Strings/components/utils/io/io.h>
7 
10 
12 {
19  {
20  public:
22  {
23  name = "explore";
24  description = "opens an engine data directory in the system file explorer.";
25  syntax = "explore <user|engine> <string>";
26 
28  }
29 
31  {
32 
33  }
34 
35  BlamCommandResult onCommand(std::vector<std::string> arguments)
36  {
37  if (arguments.size() < 2)
38  {
40  }
41  else
42  {
43  std::string type = arguments.at(0);
44  std::string folder = arguments.at(1);
45 
46  std::string file_path = "";
47 
48  if (BlamStrings::Utils::String::ToLower(type) == "user")
49  {
51  }
52  else
53  {
55  }
56 
57  Blam::Logger::LogEvent("attempting to explore directory '" + file_path + "'");
58  BlamStrings::Utils::IO::ExploreDirectory(file_path);
59  }
60 
61  return CMD_OK;
62  }
63  };
64 }
CMD_ERR_WRONG_ARGS_COUNT
#define CMD_ERR_WRONG_ARGS_COUNT
Macro for Wrong Arg Count command status. See #Blam::Resources::Console::WrongArgumentCount for more ...
Definition: console.h:10
Blam::Settings::Paths::GetUserDataFolderFromString
BLAM BlamUserDataFolder GetUserDataFolderFromString(std::string folder)
Attempts to convert a string to the equivalent user data folder.
Definition: paths.cpp:285
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:141
Blam::Resources::Console::ExploreCommand::ExploreCommand
ExploreCommand()
Definition: explore.hpp:21
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:57
logger.h
Blam::Resources::Console::ExploreCommand::~ExploreCommand
~ExploreCommand()
Definition: explore.hpp:30
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:54
USER_DATA_PATH
#define USER_DATA_PATH(path)
Macro to quickly access a user data folder.
Definition: config.h:43
ENGINE_DATA_PATH
#define ENGINE_DATA_PATH(path)
Macro to quickly access a game engine data folder.
Definition: config.h:36
Blam::Resources::Console::ExploreCommand
Class for the explore command.
Definition: explore.hpp:18
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:56
Blam::Resources::Console::ExploreCommand::onCommand
BlamCommandResult onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition: explore.hpp:35
BlamConsoleCommand::syntax
std::string syntax
The syntax information for the command. Shown to the user when using the help command with an argumen...
Definition: console.h:58
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:61
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.
CMD_OK
#define CMD_OK
Macro for OK command status. See #Blam::Resources::Console::Ok for more details.
Definition: console.h:8
BlamCommandResult
BlamCommandResult
Indicates the return state of a console command.
Definition: console.h:22
config.h
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
Blam::Settings::Paths::GetEngineDataFolderFromString
BLAM BlamEngineDataFolder GetEngineDataFolderFromString(std::string folder)
Attempts to convert a string to the equivalent engine data folder.
Definition: paths.cpp:327