checkin from browser
authorClaus Gittinger <cg@exept.de>
Fri, 21 May 1999 17:21:19 +0200
changeset 4221 d6bfafc98991
parent 4220 f4cbb12b74dd
child 4222 a2799703a8ad
checkin from browser
Win32OS.st
Win32OperatingSystem.st
--- a/Win32OS.st	Fri May 21 14:44:16 1999 +0200
+++ b/Win32OS.st	Fri May 21 17:21:19 1999 +0200
@@ -6632,6 +6632,12 @@
     "Modified: 28.12.1995 / 14:13:41 / stefan"
 ! !
 
+!Win32OperatingSystem::RegistryEntry class methodsFor:'defaults'!
+
+separator
+    ^$\
+! !
+
 !Win32OperatingSystem::RegistryEntry class methodsFor:'initialization'!
 
 initialize
@@ -6652,6 +6658,50 @@
     "Modified: / 19.5.1999 / 22:17:39 / cg"
 ! !
 
+!Win32OperatingSystem::RegistryEntry class methodsFor:'instance creation'!
+
+key:aKeyNamePath
+    |idx path first rest root|
+
+    idx :=
+    idx := aKeyNamePath indexOf:(self separator).
+    idx == 0 ifTrue:[
+        first := aKeyNamePath.
+        rest := nil.
+    ] ifFalse:[
+        first := aKeyNamePath copyTo:idx-1.
+        rest := aKeyNamePath copyFrom:idx+1
+    ].
+
+    first := first asUppercase.
+
+    "/ the first is a pseudo name
+    first = 'HKEY_LOCAL_MACHINE' ifTrue:[
+        root := self HKEY_LOCAL_MACHINE.
+    ] ifFalse:[
+        first = 'HKEY_USERS' ifTrue:[
+            root := self HKEY_USERS.
+        ] ifFalse:[
+            first = 'HKEY_CURRENT_USER' ifTrue:[
+                root := self HKEY_CURRENT_USER.
+            ] ifFalse:[
+                first = 'HKEY_CLASSES_ROOT' ifTrue:[
+                    root := self HKEY_CLASSES_ROOT.
+                ]
+            ]
+        ]
+    ].
+    root isNil ifTrue:[
+        ^ nil
+    ].
+
+    ^ root subKey:rest.
+
+    "
+     self key:'HKEY_LOCAL_MACHINE\Software'      
+    "
+! !
+
 !Win32OperatingSystem::RegistryEntry class methodsFor:'root entries'!
 
 HKEY_CLASSES_ROOT
@@ -6770,6 +6820,12 @@
 
 ! !
 
+!Win32OperatingSystem::RegistryEntry methodsFor:'enumeration'!
+
+subKeyNamesDo:aBlock
+
+! !
+
 !Win32OperatingSystem::RegistryEntry methodsFor:'instance release'!
 
 close
@@ -6867,6 +6923,6 @@
 !Win32OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/Win32OS.st,v 1.55 1999-05-21 10:17:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/Win32OS.st,v 1.56 1999-05-21 15:21:19 cg Exp $'
 ! !
 Win32OperatingSystem initialize!
--- a/Win32OperatingSystem.st	Fri May 21 14:44:16 1999 +0200
+++ b/Win32OperatingSystem.st	Fri May 21 17:21:19 1999 +0200
@@ -6632,6 +6632,12 @@
     "Modified: 28.12.1995 / 14:13:41 / stefan"
 ! !
 
+!Win32OperatingSystem::RegistryEntry class methodsFor:'defaults'!
+
+separator
+    ^$\
+! !
+
 !Win32OperatingSystem::RegistryEntry class methodsFor:'initialization'!
 
 initialize
@@ -6652,6 +6658,50 @@
     "Modified: / 19.5.1999 / 22:17:39 / cg"
 ! !
 
+!Win32OperatingSystem::RegistryEntry class methodsFor:'instance creation'!
+
+key:aKeyNamePath
+    |idx path first rest root|
+
+    idx :=
+    idx := aKeyNamePath indexOf:(self separator).
+    idx == 0 ifTrue:[
+        first := aKeyNamePath.
+        rest := nil.
+    ] ifFalse:[
+        first := aKeyNamePath copyTo:idx-1.
+        rest := aKeyNamePath copyFrom:idx+1
+    ].
+
+    first := first asUppercase.
+
+    "/ the first is a pseudo name
+    first = 'HKEY_LOCAL_MACHINE' ifTrue:[
+        root := self HKEY_LOCAL_MACHINE.
+    ] ifFalse:[
+        first = 'HKEY_USERS' ifTrue:[
+            root := self HKEY_USERS.
+        ] ifFalse:[
+            first = 'HKEY_CURRENT_USER' ifTrue:[
+                root := self HKEY_CURRENT_USER.
+            ] ifFalse:[
+                first = 'HKEY_CLASSES_ROOT' ifTrue:[
+                    root := self HKEY_CLASSES_ROOT.
+                ]
+            ]
+        ]
+    ].
+    root isNil ifTrue:[
+        ^ nil
+    ].
+
+    ^ root subKey:rest.
+
+    "
+     self key:'HKEY_LOCAL_MACHINE\Software'      
+    "
+! !
+
 !Win32OperatingSystem::RegistryEntry class methodsFor:'root entries'!
 
 HKEY_CLASSES_ROOT
@@ -6770,6 +6820,12 @@
 
 ! !
 
+!Win32OperatingSystem::RegistryEntry methodsFor:'enumeration'!
+
+subKeyNamesDo:aBlock
+
+! !
+
 !Win32OperatingSystem::RegistryEntry methodsFor:'instance release'!
 
 close
@@ -6867,6 +6923,6 @@
 !Win32OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.55 1999-05-21 10:17:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.56 1999-05-21 15:21:19 cg Exp $'
 ! !
 Win32OperatingSystem initialize!