Class: Syspy::TdsLanguage

Inherits:
TdsPackage show all
Defined in:
lib/tds_packages/tds_language.rb

Constant Summary collapse

STATUS_PARAMETERIZED =
0x01

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from TdsPackage

#read_int, #read_int16, #read_int32, #read_text, #read_uint, #read_uint16, #read_uint32

Constructor Details

#initialize(io, length) ⇒ TdsLanguage

Returns a new instance of TdsLanguage.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/tds_packages/tds_language.rb', line 10

def initialize(io,length)
  @status = read_uint(io)        
  @language_text = read_text(io,length - 1)     
  if(@status == 1 && !io.eof?)
    token = read_uint(io)
    if(token == TdsTokens::TDS_PARAMFMT || token == TdsTokens::TDS_PARAMFMT2)
      paramfmt_length = Bytes.uintle(io,TdsTokens.length_field_size(token))
      if(paramfmt_length < 1000000)          
        @tds_paramfmt = TdsTokens.token_class(token).new(io,paramfmt_length)
        if(@tds_paramfmt.params_count > 0)
          token = read_uint(io)
          if(token == TdsTokens::TDS_PARAMS)
            @tds_params = TdsParams.new(io,@tds_paramfmt)
          end
        end
      else
        Log.warn("Illegal paramfmt length: #{paramfmt_length}")
      end          
    end
  end      
end

Instance Attribute Details

#language_textObject (readonly)

Returns the value of attribute language_text.



6
7
8
# File 'lib/tds_packages/tds_language.rb', line 6

def language_text
  @language_text
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/tds_packages/tds_language.rb', line 6

def status
  @status
end

#tds_paramfmtObject (readonly)

Returns the value of attribute tds_paramfmt.



6
7
8
# File 'lib/tds_packages/tds_language.rb', line 6

def tds_paramfmt
  @tds_paramfmt
end

#tds_paramsObject (readonly)

Returns the value of attribute tds_params.



6
7
8
# File 'lib/tds_packages/tds_language.rb', line 6

def tds_params
  @tds_params
end