# ***********************************************
# 
# !!!! DO NOT EDIT !!!!
# 
# This file was auto-generated by Build.PL.
# 
# ***********************************************
# 
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

=encoding utf8

=head1 NAME

Clownfish::CharBuf - Growable buffer holding Unicode characters.

=head1 SYNOPSIS

    my $buf = Clownfish::CharBuf->new;
    $buf->cat('abc');
    $buf->cat_char(ord("\n"));
    print $buf->to_string;

=head1 DESCRIPTION

=head1 CONSTRUCTORS

=head2 new

    my $char_buf = Clownfish::CharBuf->new(
        capacity => $capacity,  # default: 0
    );

Return a new CharBuf.

=over

=item *

B<capacity> - Initial minimum capacity of the CharBuf, in bytes.

=back

=head1 METHODS

=head2 cat

    $char_buf->cat($string);

Concatenate the contents of L<String|Clownfish::String> C<string> onto the end of the
caller.

=over

=item *

B<string> - The String to concatenate.

=back

=head2 cat_char

    $char_buf->cat_char($code_point);

Concatenate one Unicode character onto the end of the CharBuf.

=over

=item *

B<code_point> - The code point of the Unicode character.

=back

=head2 grow

    $char_buf->grow($capacity);

Assign more memory to the CharBuf, if it doesn’t already have enough
room to hold a string of C<size> bytes.  Cannot shrink the
allocation.

=over

=item *

B<capacity> - The new minimum capacity of the ByteBuf.

=back

=head2 clear

    $char_buf->clear();

Clear the CharBuf.

=head2 get_size

    my $int = $char_buf->get_size();

Return the size of the CharBuf’s content in bytes.

=head2 clone

    my $result = $char_buf->clone();

Return a clone of the object.

=head2 yield_string

    my $string = $char_buf->yield_string();

Return the content of the CharBuf as L<String|Clownfish::String> and clear the CharBuf.
This is more efficient than L<to_string()|Clownfish::Obj/to_string>.

=head1 INHERITANCE

Clownfish::CharBuf isa L<Clownfish::Obj>.

=cut

