+ size_t pos = value.find_first_of(':');
+ if (pos == std::string::npos)
+ throw ParserError("Connection type is not specified. Should be either 'unix' or 'tcp'.");
+ if (connectionType == Config::UNIX)
+ return value.substr(pos + 1);
+ std::string address(value.substr(pos + 1));
+ pos = address.find_first_of(':', pos + 1);
+ if (pos == std::string::npos)
+ throw ParserError("Port is not specified.");
+ return address.substr(0, pos - 1);
+}
+
+std::string parsePort(Config::Type connectionType, const std::string& value)
+{
+ size_t pos = value.find_first_of(':');
+ if (pos == std::string::npos)
+ throw ParserError("Connection type is not specified. Should be either 'unix' or 'tcp'.");
+ if (connectionType == Config::UNIX)
+ return "";
+ std::string address(value.substr(pos + 1));
+ pos = address.find_first_of(':', pos + 1);