18 if (txt.length() >= 1) {
29 size_t mid = txt.find(
":/");
30 if (
mid != std::string::npos &&
mid > 0) {
31 std::string first = txt.substr(0,
mid);
32 std::string second = txt.substr(
mid + 2);
33 if (first.length() >= 2) {
34 if (first[0] ==
'/') {
35 first = first.substr(1);
38 return Contact(second, first,
"", -1);
40 return Contact(txt,
"",
"", -1);
47 std::string
work = txt;
49 if (
mid != std::string::npos &&
mid > 0) {
51 std::string target = std::string(
"+") +
mod +
".";
53 if (
modLoc != std::string::npos) {
56 if (
endLoc != std::string::npos) {
65 return ok ?
work :
"";
A mini-server for performing network communication in the background.
Contact toAddress() const
Create an address from the name.
Name(const std::string &txt)
Constructor.
bool isRooted() const
Check if port name begins with "/".
std::string getCarrierModifier(const char *mod, bool *hasModifier=nullptr)
An interface to the operating system, including Port based communication.