Class: R3EXS::StringsInjector::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/R3EXS/ast.rb

Overview

用来记录字符串的位置

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_offset, length, content) ⇒ Location

Note:

start_offset 是字符串在二进制下打开时的位置

Parameters:

  • start_offset (Integer)

    字符串在源文件中的起始位置

  • length (Integer)

    字符串的长度

  • content (String)

    字符串内容



121
122
123
124
125
# File 'lib/R3EXS/ast.rb', line 121

def initialize(start_offset, length, content)
  @start_offset = start_offset
  @length = length
  @content = content
end

Instance Attribute Details

#contentString (readonly)

字符串内容

Returns:



112
113
114
# File 'lib/R3EXS/ast.rb', line 112

def content
  @content
end

#lengthInteger (readonly)

字符串的长度

Returns:

  • (Integer)


107
108
109
# File 'lib/R3EXS/ast.rb', line 107

def length
  @length
end

#start_offsetInteger (readonly)

字符串在二进制源文件中的起始位置

Returns:

  • (Integer)


102
103
104
# File 'lib/R3EXS/ast.rb', line 102

def start_offset
  @start_offset
end