Clownfish::CharBuf - Growable buffer holding Unicode characters.
my $buf = Clownfish::CharBuf->new; $buf->cat('abc'); $buf->cat_char(ord("\n")); print $buf->to_string;
my $char_buf = Clownfish::CharBuf->new( capacity => $capacity # default: 0 );
Return a new CharBuf.
$char_buf->cat($string);
Concatenate the contents of String string
onto the end of the caller.
$char_buf->cat_char($code_point);
Concatenate one Unicode character onto the end of the CharBuf.
$char_buf->grow($capacity);
Assign more memory to the CharBuf,
if it doesn’t already have enough room to hold a string of size
bytes.
Cannot shrink the allocation.
$char_buf->clear();
Clear the CharBuf.
my $int = $char_buf->get_size();
Return the size of the CharBuf’s content in bytes.
my $result = $char_buf->clone();
Return a clone of the object.
my $string = $char_buf->yield_string();
Return the content of the CharBuf as String and clear the CharBuf. This is more efficient than to_string().
Clownfish::CharBuf isa Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.