Class: Dtrace::Dof::Section::Strtab

Inherits:
Dtrace::Dof::Section show all
Defined in:
lib/dtrace/dof/section/strtab.rb

Overview

Ruby-Dtrace © 2008 Chris Andrews <[email protected]>

Instance Attribute Summary

Attributes inherited from Dtrace::Dof::Section

#align, #data, #dof, #entsize, #flags, #offset, #pad, #section_type, #size

Instance Method Summary collapse

Methods inherited from Dtrace::Dof::Section

#dof_generate_comments, #dof_generate_prargs, #dof_generate_prenoffs, #dof_generate_probes, #dof_generate_proffs, #dof_generate_provider, #dof_generate_relhdr, #dof_generate_reltab, #dof_generate_strtab, #dof_generate_utsname, #generate, #generate_header

Constructor Details

#initialize(index) ⇒ Strtab

Returns a new instance of Strtab.



7
8
9
10
11
# File 'lib/dtrace/dof/section/strtab.rb', line 7

def initialize(index)
  super(DOF_SECT_STRTAB, index)
  self.data = []
  @idx = 1
end

Instance Method Details

#add(string) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/dtrace/dof/section/strtab.rb', line 13

def add(string)
  idx = @idx
  string = string.to_s
  @idx += (string.length + 1)
  self.data << string
  return idx
end