18 #ifndef IOX_POSH_GW_TOML_FILE_CONFIG_PARSER_HPP
19 #define IOX_POSH_GW_TOML_FILE_CONFIG_PARSER_HPP
21 #include "iceoryx_posh/gateway/gateway_config.hpp"
22 #include "iceoryx_posh/iceoryx_posh_types.hpp"
23 #include "iceoryx_utils/cxx/expected.hpp"
31 enum TomlGatewayConfigParseError
35 INCOMPLETE_CONFIGURATION,
36 INCOMPLETE_SERVICE_DESCRIPTION,
37 INVALID_SERVICE_DESCRIPTION,
41 constexpr
char TOML_GATEWAY_CONFIG_FILE_PARSE_ERROR_STRINGS[][64] = {
"INVALID_STATE",
43 "INCOMPLETE_CONFIGURATION",
44 "INCOMPLETE_SERVICE_DESCRIPTION",
45 "INVALID_SERVICE_DESCRIPTION",
46 "EXCEPTION_IN_PARSER"};
48 static constexpr
const char REGEX_VALID_CHARACTERS[] =
"^[a-zA-Z_][a-zA-Z0-9_]*$";
50 static constexpr
const char DEFAULT_CONFIG_FILE_PATH[] =
"/etc/iceoryx/gateway_config.toml";
51 static constexpr
const char GATEWAY_CONFIG_SERVICE_TABLE_NAME[] =
"services";
52 static constexpr
const char GATEWAY_CONFIG_SERVICE_NAME[] =
"service";
53 static constexpr
const char GATEWAY_CONFIG_SERVICE_INSTANCE_NAME[] =
"instance";
54 static constexpr
const char GATEWAY_CONFIG_SERVICE_EVENT_NAME[] =
"event";
62 static cxx::expected<GatewayConfig, TomlGatewayConfigParseError> parse();
63 static cxx::expected<GatewayConfig, TomlGatewayConfigParseError> parse(
const roudi::ConfigFilePathString_t& path);
66 static cxx::expected<TomlGatewayConfigParseError> validate(
const cpptoml::table& parsedToml) noexcept;
69 static bool hasInvalidCharacter(
const std::string& s) noexcept;
The TomlGatewayConfigParser class provides methods for parsing gateway configs from toml text files.
Definition: toml_gateway_config_parser.hpp:60
Definition: service_description.hpp:29