forked from log2timeline/plaso
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Worked on attribute container identifiers log2timeline#771
- Loading branch information
1 parent
0d0bce9
commit ecb749f
Showing
3 changed files
with
69 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Storage attribute container identifier objects.""" | ||
|
||
from plaso.containers import interface as containers_interface | ||
|
||
|
||
class SerializedStreamIdentifier( | ||
containers_interface.AttributeContainerIdentifier): | ||
"""Class that defines the serialized stream attribute container identifier. | ||
The identifier is used to uniquely identify attribute containers. | ||
Attributes: | ||
stream_number (int): number of the serialized attribute container stream. | ||
entry_index (int): number of the serialized event within the stream. | ||
""" | ||
|
||
def __init__(self, stream_number, entry_index): | ||
"""Initializes a serialized stream attribute container identifier. | ||
Args: | ||
stream_number (int): number of the serialized attribute container stream. | ||
entry_index (int): number of the serialized event within the stream. | ||
""" | ||
super(SerializedStreamIdentifier, self).__init__() | ||
self.entry_index = entry_index | ||
self.stream_number = stream_number | ||
|
||
@property | ||
def identifier(self): | ||
"""str: unique identifier or None.""" | ||
return u'{0:d}.{1:d}'.format(self.stream_number, self.entry_index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters