Class: Cxxproject::ErrorParser

Inherits:
Object
  • Object
show all
Defined in:
lib/cxxproject/errorparser/error_parser.rb

Direct Known Subclasses

IDEInterface

Constant Summary collapse

SEVERITY_INFO =
0
SEVERITY_WARNING =
1
SEVERITY_ERROR =
2
SEVERITY_OK =
255

Instance Method Summary collapse

Instance Method Details

#get_severity(str) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cxxproject/errorparser/error_parser.rb', line 24

def get_severity(str)
  if str == "info" || str == "note"
    SEVERITY_INFO
  elsif str == "warning"
    SEVERITY_WARNING
  elsif str == "error"
    SEVERITY_ERROR
  else
    raise "Unknown severity: #{str}"
  end
end

#scan(consoleOutput, proj_dir) ⇒ Object



20
21
22
# File 'lib/cxxproject/errorparser/error_parser.rb', line 20

def scan(consoleOutput, proj_dir)
  raise "Use specialized classes only"
end

#scan_lines(consoleOutput, proj_dir) ⇒ Object

scan the output from the console line by line and return a list of ErrorDesc objects. for none-error/warning lines the description object will indicate that as severity 255 for single line errors/warnings: description will contain severity, line-number, message and file-name

for multi-line errors/warnings:

one description object for each line, first one will contain all single line error information,
all following desc.objects will just repeat the severity and include the message


44
45
46
# File 'lib/cxxproject/errorparser/error_parser.rb', line 44

def scan_lines(consoleOutput, proj_dir)
  raise "Use specialized classes only"
end