mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-01 02:56:28 +03:00
62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <eepp/core/containers.hpp>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
using namespace std::literals;
|
|
|
|
using json = nlohmann::json;
|
|
|
|
using namespace EE;
|
|
|
|
namespace ecode {
|
|
|
|
static const auto REQUEST = "request"sv;
|
|
static const auto REDIRECT_STDERR = "redirectStderr"sv;
|
|
static const auto REDIRECT_STDOUT = "redirectStdout"sv;
|
|
|
|
struct Command {
|
|
std::string command;
|
|
std::vector<std::string> arguments;
|
|
std::unordered_map<std::string, std::string> environment;
|
|
bool isValid() const;
|
|
};
|
|
|
|
struct Connection {
|
|
int port;
|
|
std::string host;
|
|
bool isValid() const;
|
|
};
|
|
|
|
struct BusSettings {
|
|
std::optional<Command> command;
|
|
std::optional<Connection> connection;
|
|
|
|
bool isValid() const;
|
|
bool hasCommand() const;
|
|
bool hasConnection() const;
|
|
};
|
|
|
|
struct ProtocolSettings {
|
|
bool linesStartAt1{ true };
|
|
bool columnsStartAt1{ true };
|
|
bool pathFormatURI{ false };
|
|
bool redirectStderr{ false };
|
|
bool redirectStdout{ false };
|
|
bool supportsSourceRequest{ true };
|
|
bool runTarget{ false };
|
|
std::string launchRequestType{ "launch" };
|
|
json launchArgs;
|
|
std::string locale{ "en-US" };
|
|
|
|
ProtocolSettings() = default;
|
|
|
|
ProtocolSettings( const nlohmann::json& configuration );
|
|
};
|
|
|
|
} // namespace ecode
|