18#ifndef _DECAF_LANG_STRINGBUFFER_H_
19#define _DECAF_LANG_STRINGBUFFER_H_
108 virtual void getChars(
int start,
int end,
char* dst,
int dstSize,
int dstStart)
const;
145 template<
typename POINTER>
148 if (pointer ==
NULL) {
166 template<
typename TYPE>
169 if (pointer ==
NULL) {
364 template<
typename POINTER>
367 if (pointer ==
NULL) {
370 doInsert(index, pointer->toString());
387 template<
typename TYPE>
390 if (pointer ==
NULL) {
393 doInsert(index, pointer->toString());
void doInsert(int index, char value)
Inserts a single char value at the given index.
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 & insert(int index, const std::string &value)
Inserts the given std::string into the character buffer at the given index.
virtual int capacity() const
Returns the current capacity.
StringBuffer(const CharSequence *source)
Constructs a string buffer initialized to the contents of the specified string.
StringBuffer & append(short value)
Appends the given short value into the internal char buffer.
StringBuffer & deleteRange(int start, int end)
Removes the characters in a substring of this buffer.
virtual String substring(int start) const
Returns a new String that contains a subset of the characters currently contained in this character b...
virtual String toString() const
Returns a String that represents the contents of this buffer.
virtual int indexOf(const String &value, int start) const
Search for the index within this string of the first occurrence of the specified substring starting a...
StringBuffer & append(float value)
Appends the given float value into the internal char buffer.
virtual void setLength(int length)
Sets the length of this character buffer.
StringBuffer & append(int value)
Appends the given int value into the internal char buffer.
StringBuffer & append(long long value)
Appends the given long long value into the internal char buffer.
StringBuffer & insert(int index, const String &value)
Inserts the given String into the character buffer at the given index.
virtual void ensureCapacity(int minCapacity)
Ensures that the capacity is at least equal to the specified min value.
StringBuffer & insert(int index, float value)
Inserts the given float into the character buffer at the given index.
StringBuffer & insert(int index, int value)
Inserts the given int into the character buffer at the given index.
virtual void setCharAt(int index, char value)
Sets the character at the specified index to the new char value given.
StringBuffer & append(const CharSequence *value)
Appends the contents of the CharSequence into this buffer, if the CharSequence pointer is NULL then t...
StringBuffer & reverse()
Reverses the order of characters in this builder.
StringBuffer & append(const char *value)
Appends the contents of the given C string into this buffer.
StringBuffer & insert(int index, const Pointer< TYPE > pointer)
Inserts the string representation of the given object pointer.
Definition StringBuffer.h:388
virtual void getChars(int start, int end, char *dst, int dstSize, int dstStart) const
Copies characters from this character buffer into the given character array.
StringBuffer & insert(int index, bool value)
Inserts the given boolean into the character buffer at the given index.
StringBuffer()
Creates an empty StringBuffer instance with a capacity of 16.
StringBuffer & append(bool value)
Appends the string representation of the given boolean value.
virtual String substring(int start, int end) const
Returns a new String that contains a subset of the characters currently contained in this character b...
StringBuffer & insert(int index, char value)
Inserts the given char into the character buffer at the given index.
StringBuffer & 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...
StringBuffer & append(char value)
Appends the given char value into the internal char buffer.
virtual int lastIndexOf(const String &value) const
Search for the last index within this string where the given substring can be found.
virtual void trimToSize()
Attempts to reduce storage used for the character sequence.
StringBuffer & append(double value)
Appends the given double value into the internal char buffer.
StringBuffer & insert(int index, const POINTER *pointer)
Inserts the string representation of the given object pointer.
Definition StringBuffer.h:365
StringBuffer & 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...
StringBuffer & insert(int index, long long value)
Inserts the given long long into the character buffer at the given index.
virtual CharSequence * subSequence(int start, int end) const
Creates and returns a new CharSequence object that is a subset of the characters contained in this ch...
StringBuffer(int capacity)
Creates an empty StringBuffer instance with the given capacity.
StringBuffer & 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...
StringBuffer & replace(int start, int end, const String &value)
Replace some number of characters in this Buffer with the value given.
StringBuffer & append(const StringBuilder &value)
Appends the contents of the StringBuffer into this buffer.
virtual char charAt(int index) const
Returns the character at the given index.
virtual int indexOf(const String &value) const
Search for the index within this string of the first occurrence of the specified substring.
StringBuffer & deleteCharAt(int index)
Deletes the char at the specified position in this buffer, length decreases by one.
StringBuffer & insert(int index, const CharSequence *value)
Inserts the given CharSequence into the character buffer at the given index starting from the given o...
StringBuffer & append(const char *value, int offset, int length)
Appends the given subsequence of the given C string into this buffer.
StringBuffer & append(const Pointer< TYPE > pointer)
Appends the string representation of the given object pointer.
Definition StringBuffer.h:167
StringBuffer & insert(int index, short value)
Inserts the given short into the character buffer at the given index.
StringBuffer & append(const String &value)
Appends the contents of the String into this buffer.
virtual int lastIndexOf(const String &value, int start) const
Search for the last index within this string where the given substring can be found starting from the...
StringBuffer & insert(int index, const char *value)
Inserts the given C string into the character buffer at the given index.
StringBuffer(const String &source)
Constructs a string buffer initialized to the contents of the specified string.
StringBuffer & append(const POINTER *pointer)
Appends the string representation of the given object pointer.
Definition StringBuffer.h:146
virtual int length() const
Returns the current length of the String that has been built.
StringBuffer & insert(int index, double value)
Inserts the given double into the character buffer at the given index.
A modifiable sequence of characters for use in creating and modifying Strings.
Definition StringBuilder.h:52
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