Path: blob/master/lib/rex/ui/text/output/buffer.rb
19715 views
# -*- coding: binary -*-12module Rex3module Ui4module Text56###7#8# This class implements output against a buffer.9#10###11class Output::Buffer < Rex::Ui::Text::Output1213#14# Initializes an output buffer.15#16def initialize17self.buf = ''18end1920def supports_color?21false22end2324#25# Appends the supplied message to the output buffer.26#27def print_raw(msg = '')28self.buf += msg || ''2930msg31end323334#35# Read everything out of the buffer and reset it36#37def dump_buffer38self.buf ||= ''39buffer = self.buf.dup40reset()41buffer42end4344#45# Reset the buffer to an empty string.46#47def reset48self.buf = ''49end5051#52# The underlying buffer state.53#54attr_accessor :buf5556end5758end59end60end616263