Class: Mapi::Pst::NodePtr
- Inherits:
-
Struct
- Object
- Struct
- Mapi::Pst::NodePtr
- Includes:
- Module.new
- Defined in:
- lib/mapi/pst.rb
Overview
pst_desc idx_id is a pointer to an idx record which gets the primary data stream for the Desc record. idx2_id gets you an idx record, that when read gives you an ID2 association list, which just maps another set of ids to index values
Constant Summary collapse
- UNPACK_STR32 =
'V4'
- UNPACK_STR64 =
'T3V'
- SIZE32 =
16
- SIZE64 =
32
- BLOCK_SIZE =
descriptor blocks was 520 but bogus
512
- COUNT_MAX64 =
15
- COUNT_MAX32 =
max active desc records (ITEM_COUNT_OFFSET / Desc::SIZE = 31)
31
Instance Attribute Summary collapse
-
#block_id ⇒ Object
Returns the value of attribute block_id.
- #children ⇒ Array readonly
-
#node_id ⇒ Object
Returns the value of attribute node_id.
-
#parent_node_id ⇒ Object
Returns the value of attribute parent_node_id.
- #pst ⇒ Pst
-
#sub_block_id ⇒ Object
Returns the value of attribute sub_block_id.
Instance Method Summary collapse
- #block ⇒ BlockPtr
- #get_local_node_list ⇒ Array<String>
-
#has_sub(local_node_id) ⇒ Boolean
Check if there is a sub data exists, where it is identified by its local id.
-
#initialize(data, is64) ⇒ NodePtr
constructor
A new instance of NodePtr.
-
#inspect ⇒ Object
show all numbers in hex.
-
#read_main_array ⇒ Array<String>
Read node data.
-
#read_sub_array(local_node_id) ⇒ Array<String>
Locate and read node sub data by its local id.
- #sub_block ⇒ BlockPtr
Constructor Details
#initialize(data, is64) ⇒ NodePtr
Returns a new instance of NodePtr.
476 477 478 479 |
# File 'lib/mapi/pst.rb', line 476 def initialize data, is64 super(*Pst.unpack(data, is64 ? UNPACK_STR64 : UNPACK_STR32)) @children = [] end |
Instance Attribute Details
#block_id ⇒ Object
Returns the value of attribute block_id
457 458 459 |
# File 'lib/mapi/pst.rb', line 457 def block_id @block_id end |
#children ⇒ Array (readonly)
472 473 474 |
# File 'lib/mapi/pst.rb', line 472 def children @children end |
#node_id ⇒ Object
Returns the value of attribute node_id
457 458 459 |
# File 'lib/mapi/pst.rb', line 457 def node_id @node_id end |
#parent_node_id ⇒ Object
Returns the value of attribute parent_node_id
457 458 459 |
# File 'lib/mapi/pst.rb', line 457 def parent_node_id @parent_node_id end |
#sub_block_id ⇒ Object
Returns the value of attribute sub_block_id
457 458 459 |
# File 'lib/mapi/pst.rb', line 457 def sub_block_id @sub_block_id end |
Instance Method Details
#block ⇒ BlockPtr
482 483 484 485 |
# File 'lib/mapi/pst.rb', line 482 def block raise "DO NOT USE" pst.block_from_id block_id end |
#get_local_node_list ⇒ Array<String>
515 516 517 518 519 |
# File 'lib/mapi/pst.rb', line 515 def get_local_node_list list = [] pst.get_local_node_list_to node_id, list list end |
#has_sub(local_node_id) ⇒ Boolean
Check if there is a sub data exists, where it is identified by its local id
525 526 527 528 |
# File 'lib/mapi/pst.rb', line 525 def has_sub local_node_id #TODO fixme read_sub_array(local_node_id).length != 0 end |
#inspect ⇒ Object
show all numbers in hex
531 532 533 |
# File 'lib/mapi/pst.rb', line 531 def inspect super.gsub(/=(\d+)/) { '=0x%x' % $1.to_i } end |
#read_main_array ⇒ Array<String>
Read node data
496 497 498 499 500 501 502 |
# File 'lib/mapi/pst.rb', line 496 def read_main_array @read_main ||= begin list = [] pst.load_node_main_data_to node_id, list list end end |
#read_sub_array(local_node_id) ⇒ Array<String>
Locate and read node sub data by its local id
508 509 510 511 512 |
# File 'lib/mapi/pst.rb', line 508 def read_sub_array local_node_id list = [] pst.load_node_sub_data_to node_id, local_node_id, list list end |
#sub_block ⇒ BlockPtr
488 489 490 491 |
# File 'lib/mapi/pst.rb', line 488 def sub_block raise "DO NOT USE" pst.block_from_id sub_block_id end |