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

Class CrashContainer


Manages a database of persistent Crash objects, trying to avoid duplicates.


See Also: Crash.key

Nested Classes [hide private]
  __CrashContainerIterator
Iterator of Crash objects.
Instance Methods [hide private]
 
__init__(self, filename=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__del__(self)
bool
__contains__(self, crash)
Returns: True if the Crash object is in the container.
iterator
__iter__(self)
Returns: Iterator of the contained Crash objects.
int
__len__(self)
Returns: Count of Crash elements in the container.
bool
__bool__(self)
Returns: False if the container is empty.
bool
has_key(self, key)
Returns: True if a matching Crash object is in the container.
iterator
iterkeys(self)
Returns: Iterator of the contained Crash object keys.
iterator
itervalues(self)
Returns: Iterator of the contained Crash objects.
 
add(self, crash)
Adds a new crash to the container.
 
remove(self, crash)
Removes a crash from the container.
Crash object.
get(self, key)
Retrieves a crash from the container.
str
__marshall_key(self, key)
Marshalls a Crash key to be used in the database.
(opaque object)
__unmarshall_key(self, key)
Unmarshalls a Crash key read from the database.
str
__marshall_value(self, value)
Marshalls a Crash object to be used in the database.
Crash
__unmarshall_value(self, value)
Unmarshalls a Crash object read from the database.

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename=None)
(Constructor)

 

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

Parameters:
  • filename (str) - (Optional) File name for crash database. If no filename is specified, the container is be volatile.

    Volatile containers are stored only in memory and destroyed when they go out of scope.

Overrides: object.__init__

__contains__(self, crash)
(In operator)

 
Parameters:
  • crash (Crash) - Crash object.
Returns: bool
True if the Crash object is in the container.

__iter__(self)

 
Returns: iterator
Iterator of the contained Crash objects.

See Also: itervalues

__len__(self)
(Length operator)

 
Returns: int
Count of Crash elements in the container.

__bool__(self)

 
Returns: bool
False if the container is empty.

has_key(self, key)

 
Parameters:
  • key (Crash unique key.) - Key of the crash to get.
Returns: bool
True if a matching Crash object is in the container.

iterkeys(self)

 
Returns: iterator
Iterator of the contained Crash object keys.

See Also: get

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.

itervalues(self)

 
Returns: iterator
Iterator of the contained Crash objects.

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.

add(self, crash)

 

Adds a new crash to the container. If the crash appears to be already known, it's ignored.

Parameters:
  • crash (Crash) - Crash object to add.

See Also: Crash.key

remove(self, crash)

 

Removes a crash from the container.

Parameters:
  • crash (Crash) - Crash object to remove.

get(self, key)

 

Retrieves a crash from the container.

Parameters:
  • key (Crash unique key.) - Key of the crash to get.
Returns: Crash object.
Crash matching the given key.

See Also: iterkeys

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.

__marshall_key(self, key)

 

Marshalls a Crash key to be used in the database.

Parameters:
  • key ((opaque object)) - Key to convert.
Returns: str
Converted key.

__unmarshall_key(self, key)

 

Unmarshalls a Crash key read from the database.

Parameters:
  • key (str) - Key to convert.
Returns: (opaque object)
Converted key.

__marshall_value(self, value)

 

Marshalls a Crash object to be used in the database.

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

__unmarshall_value(self, value)

 

Unmarshalls a Crash object read from the database.

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