Class: Syspy::TdsTokens

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

Constant Summary collapse

TOKENS =
[   
  ["TDS_ALTFMT", 0xA8, 2],
  ["TDS_ALTNAME", 0xA7, 2],
  ["TDS_ALTROW", 0xD3, nil],
  ["TDS_CAPABILITY", 0xE2, 2], 
  ["TDS_COLINFO", 0xA5, 2],
  ["TDS_COLINFO2", 0x20, 4],
  ["TDS_CONTROL", 0xAE, 2],
  ["TDS_CURCLOSE", 0x80, 2],
  ["TDS_CURDECLARE", 0x86, 2],
  ["TDS_CURDECLARE2", 0x23, 4],
  ["TDS_CURDECLARE3", 0x10, 4],
  ["TDS_CURDELETE", 0x81, 2],
  ["TDS_CURFETCH", 0x82, 2],
  ["TDS_CURINFO", 0x83, 2],
  ["TDS_CURINFO2", 0x87, 2],
  ["TDS_CURINFO3", 0x88, 2],
  ["TDS_CUROPEN", 0x84, 2],
  ["TDS_CURUPDATE", 0x85, 2],
  ["TDS_DBRPC", 0xE6, 2],
  ["TDS_DBRPC2", 0xE8, 2],
  ["TDS_DONE", 0xFD, [8]],
  ["TDS_DONEINPROC", 0xFF, [8]],
  ["TDS_DONEPROC", 0xFE, [8]],
  ["TDS_DYNAMIC", 0xE7, 2],
  ["TDS_DYNAMIC2", 0x62, 4],
  ["TDS_EED", 0xE5, 2],
  ["TDS_ENVCHANGE", 0xE3, 2],
  ["TDS_ERROR", 0xAA, 2],
  ["TDS_EVENTNOTICE", 0xA2, 2],
  ["TDS_INFO", 0xAB, 2],
  ["TDS_KEY", 0xCA, nil],
  ["TDS_LANGUAGE", 0x21, 4],
  ["TDS_LOGINACK", 0xAD, 2],
  ["TDS_LOGOUT", 0x71, [1]],
  ["TDS_MSG", 0x65, 1, 1],
  ["TDS_OFFSET", 0x78, [4]],
  ["TDS_OPTIONCMD", 0xA6, 2],
  ["TDS_ORDERBY", 0xA9, 2],
  ["TDS_ORDERBY2", 0x22, 4],
  ["TDS_PARAMFMT", 0xEC, 2],
  ["TDS_PARAMFMT2", 0x20, 4],
  ["TDS_PARAMS", 0xD7, nil],
  ["TDS_RETURNSTATUS", 0x79, [4]],
  ["TDS_RETURNVALUE", 0xAC, 2],
  ["TDS_ROW", 0xD1, nil],
  ["TDS_ROWFMT", 0xEE, 2],
  ["TDS_ROWFMT2", 0x61, 4],
  ["TDS_TABNAME", 0xA4, 2]
]
NAMES =
{}
FIXED_LENGTHS =
{}
LENGTH_FIELD_SIZES =
{}
STREAM_CLASSES =
{}

Class Method Summary collapse

Class Method Details

.fixed_length(token) ⇒ Object



96
97
98
# File 'lib/tds_tokens.rb', line 96

def self.fixed_length(token)
  FIXED_LENGTHS[token]
end

.length_field_size(token) ⇒ Object



100
101
102
# File 'lib/tds_tokens.rb', line 100

def self.length_field_size(token)
  LENGTH_FIELD_SIZES[token]
end

.token?(token) ⇒ Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/tds_tokens.rb', line 84

def self.token?(token)
  NAMES.include?(token)
end

.token_class(token) ⇒ Object



92
93
94
# File 'lib/tds_tokens.rb', line 92

def self.token_class(token)
  STREAM_CLASSES[token]
end

.token_name(token) ⇒ Object



88
89
90
# File 'lib/tds_tokens.rb', line 88

def self.token_name(token)
  NAMES[token]
end