module CacheXML

Constants

HINT_FIELDS
Hint
MAPPING_FIELDS
Mapping
Metadata
SUPERBLOCK_FIELDS
Superblock

Public Class Methods

field_names(flds) click to toggle source
# File lib/thinp_xml/cache/metadata.rb, line 15
def self.field_names(flds)
  flds.map {|p| p[0]}
end

Public Instance Methods

read_xml(io) click to toggle source
# File lib/thinp_xml/cache/parse.rb, line 63
def read_xml(io)
  l = CacheParseDetail::Listener.new
  REXML::Document.parse_stream(io, l)
  l.metadata
end
write_xml(metadata, io) click to toggle source
# File lib/thinp_xml/cache/emit.rb, line 54
def write_xml(metadata, io)
  e = CacheEmitterDetail::CacheEmitter.new(io)
  e.emit_superblock(metadata.superblock) do
    e.emit_mappings(metadata.mappings)
    e.emit_hints(metadata.hints)
  end
end