sources/network/ipaddress.h

changeset 24
e651d02802c0
parent 9
e7a09ceb4505
child 50
874bbfa55da8
--- a/sources/network/ipaddress.h	Sun Dec 14 20:47:44 2014 +0200
+++ b/sources/network/ipaddress.h	Sun Dec 14 23:21:38 2014 +0200
@@ -38,9 +38,23 @@
 
 struct IPAddress
 {
+	class StringParseError
+	{
+		String m_message;
+
+	public:
+		StringParseError (String message) :
+			m_message (message) {}
+
+		inline METHOD
+		what() const throw() -> const char*
+		{
+			return m_message.chars();
+		}
+	};
+
 	unsigned long host;
 	unsigned short port;
-	static bool sink;
 
 	IPAddress();
 	IPAddress (unsigned long host, unsigned short port);
@@ -56,8 +70,8 @@
 	inline METHOD operator!= (const IPAddress& other) const -> bool;
 	inline METHOD operator[] (int n) const -> unsigned char;
 
-	static METHOD from_string (String input, bool* ok = &sink) -> IPAddress;
-	static METHOD resolve (String node, bool* ok = &sink) -> IPAddress;
+	static METHOD from_string (String input) -> IPAddress;
+	static METHOD resolve (String node) -> IPAddress;
 };
 
 static const unsigned long localhost = 0x7F000001;

mercurial