class Nokogiri::XML::SyntaxError

def code

def code
  cstruct[:code]
end

def column

def column
  cstruct[:int2]
end

def domain

def domain
  cstruct[:domain]
end

def error?

return true if this is an error
##
def error?
  level == 2
end

def error_array_pusher(array)

def error_array_pusher(array)
  Proc.new do |_ignored_, error|
    array << wrap(error) if array
  end
end

def fatal?

return true if this error is fatal
##
def fatal?
  level == 3
end

def file

def file
  cstruct[:file].null? ? nil : cstruct[:file]
end

def initialize(message)

def initialize(message)
  self.cstruct = LibXML::XmlSyntaxError.new(LibXML::XmlSyntaxError.allocate())
  self.cstruct[:message] = LibXML.xmlStrdup(message)
end

def initialize_copy(other)

def initialize_copy(other)
  raise ArgumentError, "node must be a Nokogiri::XML::SyntaxError" unless other.is_a?(Nokogiri::XML::SyntaxError)
  LibXML.xmlCopyError(other.cstruct, cstruct)
  self
end

def int1

def int1
  cstruct[:int1]
end

def level

def level
  cstruct[:level]
end

def line

def line
  cstruct[:line]
end

def message

def message
  val = cstruct[:message]
  val.null? ? nil : val.read_string.chomp
end

def message=(string)

def message=(string)
  unless cstruct[:message].null?
    LibXML.xmlFree(cstruct[:message])
  end
  cstruct[:message] = LibXML.xmlStrdup(string)
  string
end

def none?

return true if this is a non error
##
def none?
  level == 0
end

def str1

def str1
  cstruct[:str1]
end

def str2

def str2
  cstruct[:str]
end

def str3

def str3
  cstruct[:str3]
end

def to_s

def to_s
  super.chomp
end

def warning?

return true if this is a warning
##
def warning?
  level == 1
end

def wrap(error_ptr)

def wrap(error_ptr)
  error_struct = LibXML::XmlSyntaxError.allocate
  LibXML.xmlCopyError(error_ptr, error_struct)
  error_cstruct = LibXML::XmlSyntaxError.new(error_struct)
  error = self.allocate # will generate XML::XPath::SyntaxError or XML::SyntaxError
  error.cstruct = error_cstruct
  error
end