18#ifndef _DECAF_LANG_STRINGBUILDER_H_
19#define _DECAF_LANG_STRINGBUILDER_H_
107 template<
typename POINTER>
110 if (pointer ==
NULL) {
128 template<
typename TYPE>
131 if (pointer ==
NULL) {
326 template<
typename POINTER>
329 if (pointer ==
NULL) {
332 doInsert(index, pointer->toString());
349 template<
typename TYPE>
352 if (pointer ==
NULL) {
355 doInsert(index, pointer->toString());
void doInsert(int index, char value)
Inserts a single char value at the given index.
virtual int capacity() const
Returns the current capacity.
void doAppend(const char value)
Appends the given char to this buffer.
void doAppendNull()
Appends the string "null" to the current character buffer.
An object to which char sequences and values can be appended.
Definition Appendable.h:42
A CharSequence is a readable sequence of char values.
Definition CharSequence.h:36
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
StringBuffer is a variable size contiguous indexable array of characters.
Definition StringBuffer.h:58
StringBuilder & append(const StringBuffer &value)
Appends the contents of the StringBuffer into this buffer.
StringBuilder & insert(int index, int value)
Inserts the given int into the character buffer at the given index.
StringBuilder & insert(int index, float value)
Inserts the given float into the character buffer at the given index.
StringBuilder & insert(int index, double value)
Inserts the given double into the character buffer at the given index.
StringBuilder & insert(int index, long long value)
Inserts the given long long into the character buffer at the given index.
StringBuilder & insert(int index, short value)
Inserts the given short into the character buffer at the given index.
StringBuilder & insert(int index, const char *value, int offset, int length)
Inserts the given C string into the character buffer at the given index starting from the given offse...
StringBuilder & append(float value)
Appends the given float value into the internal char buffer.
StringBuilder & append(int value)
Appends the given int value into the internal char buffer.
StringBuilder & deleteRange(int start, int end)
Removes the characters in a substring of this buffer.
StringBuilder & insert(int index, const Pointer< TYPE > pointer)
Inserts the string representation of the given object pointer.
Definition StringBuilder.h:350
StringBuilder & append(bool value)
Appends the string representation of the given boolean value.
StringBuilder & append(char value)
Appends the given char value into the internal char buffer.
StringBuilder & insert(int index, const CharSequence *value, int offset, int length)
Inserts the given CharSequence into the character buffer at the given index starting from the given o...
StringBuilder & insert(int index, char value)
Inserts the given char into the character buffer at the given index.
StringBuilder(const CharSequence *source)
Constructs a string builder initialized to the contents of the specified string.
StringBuilder & insert(int index, const char *value)
Inserts the given C string into the character buffer at the given index.
StringBuilder & append(const char *value, int offset, int length)
Appends the given subsequence of the given C string into this buffer.
StringBuilder(int capacity)
Creates an empty StringBuilder instance with the given capacity.
StringBuilder & append(double value)
Appends the given double value into the internal char buffer.
StringBuilder & replace(int start, int end, const String &value)
Replace some number of characters in this Buffer with the value given.
StringBuilder & insert(int index, const POINTER *pointer)
Inserts the string representation of the given object pointer.
Definition StringBuilder.h:327
StringBuilder & append(const Pointer< TYPE > pointer)
Appends the string representation of the given object pointer.
Definition StringBuilder.h:129
StringBuilder & append(const POINTER *pointer)
Appends the string representation of the given object pointer.
Definition StringBuilder.h:108
StringBuilder(const String &source)
Constructs a string builder initialized to the contents of the specified string.
StringBuilder & reverse()
Reverses the order of characters in this builder.
StringBuilder & append(const CharSequence *value)
Appends the contents of the CharSequence into this buffer, if the CharSequence pointer is NULL then t...
StringBuilder & append(const CharSequence *value, int offset, int length)
Appends the given CharSequence to this buffer starting at the given offset and ending after the lengt...
StringBuilder & insert(int index, const std::string &value)
Inserts the given std::string into the character buffer at the given index.
StringBuilder & insert(int index, const CharSequence *value)
Inserts the given CharSequence into the character buffer at the given index starting from the given o...
StringBuilder & append(long long value)
Appends the given long long value into the internal char buffer.
StringBuilder & append(short value)
Appends the given short value into the internal char buffer.
StringBuilder & deleteCharAt(int index)
Deletes the char at the specified position in this buffer, length decreases by one.
StringBuilder & append(const String &value)
Appends the contents of the String into this buffer.
StringBuilder()
Creates an empty StringBuilder instance with a capacity of 16.
StringBuilder & insert(int index, bool value)
Inserts the given boolean into the character buffer at the given index.
StringBuilder & append(const char *value)
Appends the contents of the given C string into this buffer.
virtual int length() const
Returns the current length of the String that has been built.
StringBuilder & insert(int index, const String &value)
Inserts the given String into the character buffer at the given index.
An immutable sequence of characters.
Definition String.h:57
#define NULL
Definition Config.h:33
#define DECAF_API
Definition Config.h:29
Definition ThreadingTypes.h:31
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25