class Pocolog::Config

Attributes

files[R]
mode[R]
mode_config[R]

Public Class Methods

new() click to toggle source
# File bin/pocolog, line 488
def initialize
    @files = []
end

Public Instance Methods

compress(file) click to toggle source

Compresses the log file

# File bin/pocolog, line 539
def compress(file)
    self.mode = CompressConfig
    mode_config.output = file
end
convert(file) click to toggle source

Converts a file in an old format into the new format

# File bin/pocolog, line 533
def convert(file)
    self.mode = ToNewFormatConfig
    mode_config.output = file
end
execute() click to toggle source

Process the file according to the given mode and options

# File bin/pocolog, line 566
def execute
    if mode_config
        mode_config.execute
    else
        mode = DisplayConfig.new(io)
        if @show_metadata
            mode.show_metadata
        end
        mode.execute
    end
end
extract(file) click to toggle source

Compresses the log file

# File bin/pocolog, line 545
def extract(file)
    self.mode = ExtractConfig
    mode_config.output = file
end
input(file) click to toggle source

Adds a file to the file list

# File bin/pocolog, line 551
def input(file)
    if mode
        raise ArgumentError, "cannot add files here"
    end
    @files << file
end
io() click to toggle source
# File bin/pocolog, line 492
def io
    files.map { |p| File.open(p, :encoding => 'BINARY') }
end
mode=(mode) click to toggle source
# File bin/pocolog, line 496
def mode=(mode)
    if @mode
        raise ArgumentError, "#{mode.optname} must be the first option"
    end
    @mode   = mode
    @mode_config = mode.new(io)
end
show(name) click to toggle source

Displays samples from name

# File bin/pocolog, line 505
def show(name)
    self.mode = DisplayConfig
    mode_config.stream(name)
end
show_metadata() click to toggle source
# File bin/pocolog, line 518
def show_metadata
    @show_metadata = true
end
type(name) click to toggle source

Displays samples from name

# File bin/pocolog, line 523
def type(name)
    if mode_config
        mode_config.type
    else
        self.mode = TypeConfig
        mode_config.typename(name)
    end
end
types() click to toggle source
# File bin/pocolog, line 510
def types
    self.mode = RegistryDisplay
end
types_xml() click to toggle source
# File bin/pocolog, line 514
def types_xml
    self.mode = XMLRegistryDisplay
end