parcel | Clownfish |
class variable | CFISH_CHARBUF |
struct symbol | cfish_CharBuf |
class nickname | cfish_CB |
header file | Clownfish/CharBuf.h |
Clownfish::CharBuf – Growable buffer holding Unicode characters.
cfish_CharBuf* // incremented
cfish_CB_new(
size_t capacity
);
Return a new CharBuf.
Initial minimum capacity of the CharBuf, in bytes.
cfish_CharBuf*
cfish_CB_init(
cfish_CharBuf *self,
size_t capacity
);
Initialize a CharBuf.
Initial minimum capacity of the CharBuf, in bytes.
void
cfish_CB_catf(
cfish_CharBuf *self,
char *pattern
);
Invokes VCatF() to concatenate formatted arguments. Note that this is only a function and not a method.
The format string.
void
cfish_CB_Cat_Utf8(
cfish_CharBuf *self,
char *utf8,
size_t size
);
Concatenate the passed-in string onto the end of the CharBuf.
Pointer to UTF-8 character data.
Size of UTF-8 character data in bytes.
void
cfish_CB_Cat_Trusted_Utf8(
cfish_CharBuf *self,
char *utf8,
size_t size
);
Concatenate the supplied text onto the end of the CharBuf. Don’t check for UTF-8 validity.
Pointer to UTF-8 character data.
Size of UTF-8 character data in bytes.
void
cfish_CB_Cat(
cfish_CharBuf *self,
cfish_String *string
);
Concatenate the contents of String string
onto the end of the
caller.
The String to concatenate.
void
cfish_CB_VCatF(
cfish_CharBuf *self,
char *pattern,
va_list args
);
Concatenate formatted arguments. Similar to the printf family, but only accepts minimal options (just enough for decent error messages).
Objects: %o
char*: %s
integers: %i8 %i32 %i64 %u8 %u32 %u64
floats: %f64
hex: %x32
Note that all Clownfish Objects, including Strings, are printed via
%o
(which invokes To_String()).
The format string.
A va_list
containing the arguments.
void
cfish_CB_Cat_Char(
cfish_CharBuf *self,
int32_t code_point
);
Concatenate one Unicode character onto the end of the CharBuf.
The code point of the Unicode character.
void
cfish_CB_Grow(
cfish_CharBuf *self,
size_t 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.
The new minimum capacity of the ByteBuf.
void
cfish_CB_Clear(
cfish_CharBuf *self
);
Clear the CharBuf.
size_t
cfish_CB_Get_Size(
cfish_CharBuf *self
);
Return the size of the CharBuf’s content in bytes.
cfish_CharBuf* // incremented
cfish_CB_Clone(
cfish_CharBuf *self
);
Return a clone of the object.
cfish_String* // incremented
cfish_CB_To_String(
cfish_CharBuf *self
);
Return the content of the CharBuf as String.
cfish_String* // incremented
cfish_CB_Yield_String(
cfish_CharBuf *self
);
Return the content of the CharBuf as String and clear the CharBuf. This is more efficient than To_String().
Clownfish::CharBuf is a 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.