NAME

Curse::Buffer - Buffer

SYNOPSIS

use Curse::Buffer;

my $buffer = Curse::Buffer->new('foo');
$buffer->add_chunk('bar');
my $foo = $buffer->remove(3);
my $bar = $buffer->empty;

DESCRIPTION

Curse::Buffer is a generic in-memory buffer.

ATTRIBUTES

raw_length

my $raw_length = $buffer->raw_length;

METHODS

Curse::Buffer inherits all methods from Nevermore and implements the following new ones.

new

my $buffer = Curse::Buffer->new;
my $buffer = Curse::Buffer->new('foobarbaz');

add_chunk

$buffer = $buffer->add_chunk('foo');

as_string

my $string = $buffer->as_string;

empty

my $string = $buffer->empty;

get_line

my $line = $buffer->get_line;

remove

my $string = $buffer->remove(4);

replace

$buffer = $buffer->replace('foobarbaz');