-
-
27 Feb 2018 08:38:55 UTC
- Distribution: Clownfish
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues
- Testers (1313 / 0 / 7)
- Kwalitee
Bus factor: 0- License: apache_2_0
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (230.31KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- The Apache Lucy Project <dev at lucy dot apache dot org>
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Clownfish::CharBuf - Growable buffer holding Unicode characters.
SYNOPSIS
my $buf = Clownfish::CharBuf->new; $buf->cat('abc'); $buf->cat_char(ord("\n")); print $buf->to_string;
DESCRIPTION
CONSTRUCTORS
new
my $char_buf = Clownfish::CharBuf->new( capacity => $capacity, # default: 0 );
Return a new CharBuf.
capacity - Initial minimum capacity of the CharBuf, in bytes.
METHODS
cat
$char_buf->cat($string);
Concatenate the contents of String
string
onto the end of the caller.string - The String to concatenate.
cat_char
$char_buf->cat_char($code_point);
Concatenate one Unicode character onto the end of the CharBuf.
code_point - The code point of the Unicode character.
grow
$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.capacity - The new minimum capacity of the ByteBuf.
clear
$char_buf->clear();
Clear the CharBuf.
get_size
my $int = $char_buf->get_size();
Return the size of the CharBuf’s content in bytes.
clone
my $result = $char_buf->clone();
Return a clone of the object.
yield_string
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().
INHERITANCE
Clownfish::CharBuf isa Clownfish::Obj.
Module Install Instructions
To install Clownfish, copy and paste the appropriate command in to your terminal.
cpanm Clownfish
perl -MCPAN -e shell install Clownfish
For more information on module installation, please visit the detailed CPAN module installation guide.