Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.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 
30  BlamResult Execute(std::vector<std::string> arguments)
31  {
32  if (arguments.size() < 2)
33  {
34  return BlamResult::Error_Command_WrongArgumentCount;
35  }
36  else
37  {
38  std::string type = arguments.at(0);
39  std::string folder = arguments.at(1);
40 
41  std::string file_path = "";
42 
43  if (BlamStrings::Utils::String::ToLower(type) == "user")
44  {
46  }
47  else
48  {
50  }
51 
52  Blam::Logger::LogEvent("attempting to explore directory '" + file_path + "'");
53  BlamStrings::Utils::IO::ExploreDirectory(file_path);
54  }
55 
56  return BlamResult::Success_OK;
57  }
58  };
59 }
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.
Blam::Settings::Paths::GetUserDataFolderFromString
BLAM BlamUserDataFolder GetUserDataFolderFromString(std::string folder)
Attempts to convert a string to the equivalent user data folder.
Definition: paths.cpp:344
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
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:34
logger.h
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:31
USER_DATA_PATH
#define USER_DATA_PATH(path)
Macro to quickly access a user data folder.
Definition: config.h:41
Blam::Resources::Console::ExploreCommand::Execute
BlamResult Execute(std::vector< std::string > arguments)
Called upon command execution.
Definition: explore.hpp:30
ENGINE_DATA_PATH
#define ENGINE_DATA_PATH(path)
Macro to quickly access a game engine data folder.
Definition: config.h:34
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:33
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:35
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:38
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:363