added #printOn:
authorClaus Gittinger <cg@exept.de>
Thu, 15 Jul 1999 21:46:26 +0200
changeset 770 32ad77c9ed74
parent 769 46ed91e332eb
child 771 74abb04ef57c
added #printOn:
IPSocketAddress.st
--- a/IPSocketAddress.st	Thu Jul 15 21:43:59 1999 +0200
+++ b/IPSocketAddress.st	Thu Jul 15 21:46:26 1999 +0200
@@ -1,6 +1,6 @@
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -22,7 +22,7 @@
 copyright
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -65,7 +65,7 @@
 
 hostAddress:addr port:portNr
     ^ self basicNew
-	hostAddress:addr port:portNr
+        hostAddress:addr port:portNr
 ! !
 
 !IPSocketAddress class methodsFor:'queries'!
@@ -97,6 +97,19 @@
     port := portNr
 ! !
 
+!IPSocketAddress methodsFor:'printing & storing'!
+
+printOn:aStream
+    "append a user printed representation of the receiver to aStream.
+     The format is suitable for a human - not meant to be read back."
+
+    address printOn:aStream.
+    port notNil ifTrue:[
+        aStream nextPut:$:.
+        port printOn:aStream.
+    ].
+! !
+
 !IPSocketAddress methodsFor:'queries'!
 
 address
@@ -130,5 +143,5 @@
 !IPSocketAddress class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/IPSocketAddress.st,v 1.5 1997-03-28 18:24:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/IPSocketAddress.st,v 1.6 1999-07-15 19:46:26 cg Exp $'
 ! !