Class: MppReader::CompObj

Inherits:
Object
  • Object
show all
Defined in:
lib/mpp_reader/comp_obj.rb

Overview

The x01CompObj stream identifies the application that wrote an OLE compound file and its file format. Layout (ported from MPXJ CompObj): 28-byte header, then length-prefixed NUL-terminated ANSI strings for application name, file format and application ID. “Microsoft Project 4.0” files carry only the application name.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ CompObj

Returns a new instance of CompObj.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/mpp_reader/comp_obj.rb', line 10

def initialize(data)
  @pos = 28
  @data = data
  @application_name = read_string
  if @application_name == "Microsoft Project 4.0"
    @file_format = "MSProject.MPP4"
    @application_id = "MSProject.Project.4"
  else
    @file_format = read_string
    @application_id = read_string
  end
end

Instance Attribute Details

#application_idObject (readonly)

Returns the value of attribute application_id.



8
9
10
# File 'lib/mpp_reader/comp_obj.rb', line 8

def application_id
  @application_id
end

#application_nameObject (readonly)

Returns the value of attribute application_name.



8
9
10
# File 'lib/mpp_reader/comp_obj.rb', line 8

def application_name
  @application_name
end

#file_formatObject (readonly)

Returns the value of attribute file_format.



8
9
10
# File 'lib/mpp_reader/comp_obj.rb', line 8

def file_format
  @file_format
end