added: #contents
authorStefan Vogel <sv@exept.de>
Fri, 30 Apr 2010 18:48:14 +0200
changeset 12909 e844bd18a3aa
parent 12908 0ebe6a3e514b
child 12910 8d6cd403131f
added: #contents answer the contents as OrderedCollection
DirectoryStream.st
--- a/DirectoryStream.st	Fri Apr 30 15:52:43 2010 +0200
+++ b/DirectoryStream.st	Fri Apr 30 18:48:14 2010 +0200
@@ -487,6 +487,23 @@
 
 !DirectoryStream methodsFor:'access-reading'!
 
+contents
+    "answer all of the directory entries as an OrderedCollection"
+
+    |contents|
+
+    contents := OrderedCollection new.
+    [self atEnd] whileFalse:[  
+        |l|
+        l := self nextLine.
+        l isNil ifTrue:[
+            ^ contents
+        ].
+        contents add:l
+    ].
+    ^ contents
+!
+
 nextLine
     "return the next filename as a string"
 
@@ -778,9 +795,9 @@
 !DirectoryStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.73 2010-02-09 18:13:24 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.74 2010-04-30 16:48:14 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.73 2010-02-09 18:13:24 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.74 2010-04-30 16:48:14 stefan Exp $'
 ! !