pyregfi
Public Member Functions
pyregfi.HiveIterator Class Reference

A special purpose iterator for registry hives. More...

List of all members.

Public Member Functions

def down
 Descends the iterator to a subkey.
def up
 Causes the iterator to ascend to the current Key's parent.
def first_subkey
 Selects first subkey of current key.
def first_value
 Selects first value of current Key.
def next_subkey
 Selects the next subkey in the current Key's list.
def next_value
 Selects the next value in the current Key's list.
def find_subkey
 Selects the first subkey which has the specified name.
def find_value
 Selects the first value which has the specified name.
def current_subkey
 Retrieves the currently selected subkey.
def current_value
 Retrieves the currently selected value.
def current_key
 Retrieves the current key.
def descend
 Traverse downward multiple levels.
def ancestry
 Obtains a list of the current key's ancestry.
def current_path
 Obtains the current path of the iterator.

Detailed Description

A special purpose iterator for registry hives.

Iterating over an object of this type causes all keys in a specific hive subtree to be returned in a depth-first manner. These iterators are typically created using the Hive.subtree() function on a Hive object.

HiveIterators can also be used to manually traverse up and down a registry hive as they retain information about the current position in the hive, along with which iteration state for subkeys and values for every parent key. See the up and down methods for more information.


Member Function Documentation

def pyregfi.HiveIterator.down (   self,
  subkey_name = None 
)

Descends the iterator to a subkey.

Descends the iterator one level to the current subkey, or a subkey specified by name.

Parameters:
subkey_nameIf specified, locates specified subkey by name (via find_subkey()) and descends to it.
Returns:
True if successful, False otherwise
def pyregfi.HiveIterator.up (   self)

Causes the iterator to ascend to the current Key's parent.

Returns:
True if successful, False otherwise
Note:
The state of current subkeys and values at this level in the tree is lost as a side effect. That is, if you go up() and then back down() again, current_subkey() and current_value() will return default selections.
def pyregfi.HiveIterator.first_subkey (   self)

Selects first subkey of current key.

Returns:
A Key instance for the first subkey. None on error or if the current key has no subkeys.
def pyregfi.HiveIterator.first_value (   self)

Selects first value of current Key.

Returns:
A Value instance for the first value. None on error or if the current key has no values.
def pyregfi.HiveIterator.next_subkey (   self)

Selects the next subkey in the current Key's list.

Returns:
A Key instance for the next subkey. None if there are no remaining subkeys or an error occurred.
def pyregfi.HiveIterator.next_value (   self)

Selects the next value in the current Key's list.

Returns:
A Value instance for the next value. None if there are no remaining values or an error occurred.
def pyregfi.HiveIterator.find_subkey (   self,
  name 
)

Selects the first subkey which has the specified name.

Returns:
A Key instance for the selected key. None if it could not be located or an error occurred.
def pyregfi.HiveIterator.find_value (   self,
  name 
)

Selects the first value which has the specified name.

Returns:
A Value instance for the selected value. None if it could not be located or an error occurred.
def pyregfi.HiveIterator.current_subkey (   self)

Retrieves the currently selected subkey.

Returns:
A Key instance of the current subkey
def pyregfi.HiveIterator.current_value (   self)

Retrieves the currently selected value.

Returns:
A Value instance of the current value
def pyregfi.HiveIterator.current_key (   self)

Retrieves the current key.

Returns:
A Key instance of the current position of the iterator
def pyregfi.HiveIterator.descend (   self,
  path 
)

Traverse downward multiple levels.

This is more efficient than calling down() multiple times

Parameters:
pathA list of Key names which represent the path to descend
Exceptions:
ExceptionIf path could not be located
def pyregfi.HiveIterator.ancestry (   self)

Obtains a list of the current key's ancestry.

Returns:
A list of all parent keys starting with the root Key and ending with the current Key
def pyregfi.HiveIterator.current_path (   self)

Obtains the current path of the iterator.

Returns:
A list of key names starting with the root up to and including the current key

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables