rename AdcEndpointPrser to AdcEndpoint

fixes
This commit is contained in:
Timur A. Fatkhullin
2024-11-02 23:59:20 +03:00
parent 75b42f40e5
commit fb43a2b378
5 changed files with 72 additions and 381 deletions

View File

@@ -108,7 +108,7 @@ int main(int argc, char* argv[])
"endpoints server will be listening for. For 'local' endpoint the '@' symbol at the beginning of the path "
"means "
"abstract namespace socket.",
cxxopts::value<std::vector<std::string>>()->default_value("local://stream/ADC_ASIO_TEST_SERVER"));
cxxopts::value<std::vector<std::string>>()->default_value("local://stream/@ADC_ASIO_TEST_SERVER"));
options.positional_help("[endpoint0] [enpoint1] ... [endpointN]");
@@ -144,13 +144,13 @@ int main(int argc, char* argv[])
auto epnt = opt_result["endpoints"].as<std::vector<std::string>>();
for (auto& ep : epnt) {
adc::AdcEndpointParser epn(ep);
adc::AdcEndpoint epn(ep);
if (epn.isValid()) {
if (epn.isLocalSeqpacket() || epn.isLocalStream()) {
if (epn.path()[0] == '@') { // replace '@' to '\0' (use of UNIX abstract namespace)
auto it = std::ranges::find(ep, '@');
*it = '\0';
epn = adc::AdcEndpointParser(ep);
epn = adc::AdcEndpoint(ep);
}
}