Evtx.Nodes.TemplateNode

Package Evtx :: Module Nodes :: Class TemplateNode |
[hide private]
[frames] | no frames]

# Class TemplateNode

source code

Instance Methods | [hide private]
__init__(self, buf, offset, chunk, parent) Constructor. | source code
__repr__(self) repr(x) | source code
__str__(self) str(x) | source code
tag_length(self) This method must be implemented and overridden for all BXmlNodes. | source code
length(self) cache the return value of a method | source code
Inherited from `BXmlNode`: `children`, `dump`, `find_end_of_stream` Inherited from `BXmlNode` (private): `_children` Inherited from `BinaryParser.Block`: `__unicode__`, `absolute_offset`, `current_field_offset`, `declare_field`, `offset`, `pack_word`, `unpack_binary`, `unpack_byte`, `unpack_dosdate`, `unpack_double`, `unpack_dword`, `unpack_dword_be`, `unpack_filetime`, `unpack_float`, `unpack_guid`, `unpack_int16`, `unpack_int32`, `unpack_int64`, `unpack_int8`, `unpack_qword`, `unpack_string`, `unpack_systemtime`, `unpack_word`, `unpack_word_be`, `unpack_wstring` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, buf, offset, chunk, parent) (Constructor) | source code
    Constructor.
    Arguments:
    - `buf`: Byte string containing stuff to parse.
    - `offset`: The offset into the buffer at which the block starts.
Overrides: object.__init__ (inherited documentation)

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

### tag_length(self) | source code
    This method must be implemented and overridden for all BXmlNodes.
    @return An integer specifying the length of this tag, not including
      its children.
Overrides: BXmlNode.tag_length (inherited documentation)

### length(self) | source code
    cache the return value of a method

    From http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/

    This class is meant to be used as a decorator of methods. The return value
    from a given method invocation will be cached on the instance whose method
    was invoked. All arguments passed to a method decorated with memoize must
    be hashable.

    If a memoized method is invoked directly on its class the result will not
    be cached. Instead the method will be invoked like a static method:
    class Obj(object):
        @memoize
        def add_to(self, arg):
            return self + arg
    Obj.add_to(1) # not enough arguments
    Obj.add_to(1, 2) # returns 3, result is not cached
Overrides: BXmlNode.length (inherited documentation)