MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / Parse

Method Parse

MonaBase/sources/IPAddress.cpp:140–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 }
139
140 static IPv4Address* Parse(Exception& ex,const char* address) {
141 if (!address || !Net::InitializeNetwork(ex))
142 return 0;
143 if (String::ICompare(address, "localhost") == 0)
144 address = LocalhostV4;
145 struct in_addr ia;
146#if defined(_WIN32)
147 ia.s_addr = inet_addr(address);
148 if (ia.s_addr == INADDR_NONE && strcmp(address,"255.255.255.255")!=0)
149 return 0;
150 return new IPv4Address(ia);
151#else
152 if (inet_aton(address, &ia))
153 return new IPv4Address(ia);
154 return 0;
155#endif
156 }
157
158
159private:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected