Package winappdbg :: Module crash :: Class ContainerBase
[hide private]
[frames] | no frames]

Class ContainerBase

source code

object --+
         |
        ContainerBase
Known Subclasses:

Base class for Container types. The code implemented here deals with marshalling and unmarshalling of Crash objects and keys, and it's independent of the database used later.


See Also: CrashContainer, CrashTable, VolatileCrashContainer, DummyCrashContainer

Instance Methods [hide private]
 
__init__(self, initialKeys=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
int
__len__(self)
Returns: Count of known keys.
source code
bool
__bool__(self)
Returns: False if there are no known keys.
source code
bool
__contains__(self, crash)
Returns: True if a Crash object with the same key is in the container.
source code
bool
has_key(self, key)
Returns: True if the key is present in the set of known keys.
source code
iterator
iterkeys(self)
Returns: Iterator of known Crash keys.
source code
 
remove_key(self, key)
Removes the given key from the set of known keys.
source code
str or buffer
marshall_key(self, key)
Marshalls a Crash key to be used in the database.
source code
Crash key.
unmarshall_key(self, key)
Unmarshalls a Crash key read from the database.
source code
str
marshall_value(self, value, storeMemoryMap=False)
Marshalls a Crash object to be used in the database.
source code
Crash
unmarshall_value(self, value)
Unmarshalls a Crash object read from the database.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
bool optimizeKeys = False
True to optimize the marshalling of keys, False otherwise.
bool optimizeValues = False
True to optimize the marshalling of keys, False otherwise.
bool compressKeys = False
True to compress keys when marshalling, False to leave them uncompressed.
bool compressValues = False
True to compress values when marshalling, False to leave them uncompressed.
bool escapeKeys = False
True to escape keys when marshalling, False to leave them uncompressed.
bool escapeValues = False
True to escape values when marshalling, False to leave them uncompressed.
bool binaryKeys = False
True to marshall keys to binary format (the Python buffer type), False to use text marshalled keys (str type).
bool binaryValues = False
True to marshall values to binary format (the Python buffer type), False to use text marshalled values (str type).
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, initialKeys=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • initialKeys (dict( key → marshalled key )) - (Optional) Use this dictionary (by reference) to add and match keys to their marshalled counterparts.
Overrides: object.__init__

__len__(self)
(Length operator)

source code 
Returns: int
Count of known keys.

__bool__(self)

source code 
Returns: bool
False if there are no known keys.

__contains__(self, crash)
(In operator)

source code 
Parameters:
  • crash (Crash) - Crash object.
Returns: bool
True if a Crash object with the same key is in the container.

has_key(self, key)

source code 
Parameters:
  • key (Crash key.) - Key to find.
Returns: bool
True if the key is present in the set of known keys.

iterkeys(self)

source code 
Returns: iterator
Iterator of known Crash keys.

remove_key(self, key)

source code 

Removes the given key from the set of known keys.

Parameters:
  • key (Crash key.) - Key to remove.

marshall_key(self, key)

source code 

Marshalls a Crash key to be used in the database.

Parameters:
  • key (Crash key.) - Key to convert.
Returns: str or buffer
Converted key.

See Also: __init__

unmarshall_key(self, key)

source code 

Unmarshalls a Crash key read from the database.

Parameters:
  • key (str or buffer) - Key to convert.
Returns: Crash key.
Converted key.

marshall_value(self, value, storeMemoryMap=False)

source code 

Marshalls a Crash object to be used in the database. The memoryMap member is NOT stored here.

Parameters:
  • value (Crash) - Object to convert.
  • storeMemoryMap (bool) - True to store the memory map, False otherwise.
Returns: str
Converted object.

Warning: Setting the storeMemoryMap argument to True can lead to a severe performance penalty!

unmarshall_value(self, value)

source code 

Unmarshalls a Crash object read from the database.

Parameters:
  • value (str) - Object to convert.
Returns: Crash
Converted object.

Class Variable Details [hide private]

optimizeKeys

True to optimize the marshalling of keys, False otherwise. Only used with the pickle module, ignored when using the more secure cerealizer module.
Type:
bool
Value:
False

optimizeValues

True to optimize the marshalling of keys, False otherwise. Only used with the pickle module, ignored when using the more secure cerealizer module.
Type:
bool
Value:
False