Project:dool
Class List Class Hierarchy
Summary: Ctors Methods

Module dool.String

Class String

Implemented interfaces:

class String



Constructor Summary
public ()
          Creates the static variables
public ()
          Creates a new empty String.
(CHAR str)
          Creates a new String that contains the array passed.
(String string)
          Copy constructor.
(void* str)
          Creates a String from a pointer to memory.
(char* str, int length)
          Create a String from a pointer to chars.
(char c)
          Creates a String from the char.
(int i)
          creates a String that is the representation of the int passed.
(uint ui)
          creates a String that is the representation of the uint passed
(long l)
          creates a String that is the representation of the long passed
(double d)
          creates a String that is the representation of the double passed
(bit b)
          Creates a string that is "0" or "1".

Methods Summary
String dup()
          Duplicates this String.
static String newz(char* str)
          Creates a String from a zero terminated pointer to chars We need this to interface to C style strings
static char* stringz(char string)
          Returns pointer to a null terminated version of string passed in.
char toString()
          Gets the array of characters of this String
char* toStringz()
          Gets a null terminated array of char version of this String
void toVoid()
          Gets this string chars as an void array
int length()
          Gets the length of this String
void length(int length)
          Sets the length of this String
void incLength(int increment)
          Increments or decrements the length of this String.
void set(String string)
          Sets this String from another String.
void set(char str)
          Sets this String from an array of chars.
void set(char* str, int length)
          Sets this String from a pointer to chars and a length.
void setz(char* str)
          Sets this String from a pointer to chars terminated ny null.
void point(char str)
          Makes this string to point to the char array.
void point(void str)
          Makes this string to point to the char array.
CHAR charAt(int index)
          Gets the character at the index position.
void print()
          
void println()
          
void print(char prefix)
          
void println(char prefix)
          
void println(String prefix)
          
String substring(int start, int end)
          Creates a new String from a slice of this string
String substring(int start)
          
String stripl()
          
String stripr()
          
String strip()
          
static String join(String[] tokens, CHAR sep)
          
static String join(String[] tokens, String sep)
          
String split()
          
String split(String delim)
          
String split(CHAR delim)
          
static String sSplit(char s, char delim)
          
String splitLines()
          
int find(dchar c)
          
bit contains(CHAR string)
          
bit contains(String string)
          
bit contains(CHAR c)
          
int find(CHAR c, int start)
          
int find(char sub, int start)
          
int find(String sub, int start)
          
int rfind(dchar c, int start)
          
int rfind(CHAR string, int start)
          
int rfind(String sub, int start)
          
String getLineText(int pos)
          
int countLine(int pos)
          counts the number of eol from the begining to pos
bit startsWith(CHAR c)
          Tests c is the first chracters on the string
bit startsWith(String string)
          Tests if the passed string is the begining of this string
bit startsWith(CHAR string)
          Tests if the passed array is the begining of this string
bit endsWith(CHAR c)
          
bit endsWith(String string)
          
bit endsWith(CHAR string)
          
static int isWhite(dchar c)
          
bit equals(String string)
          
bit equalsIgnoreCase(String string)
          
bit equalsIgnoreCase(char string)
          
String toUpper()
          
String toLower()
          
String replace(CHAR from, CHAR to)
          
String replace(CHAR from, String to)
          
String replace(String from, CHAR to)
          
String replace(String from, String to)
          
String replaceSlice(String slice, String replacement)
          
String append(char string)
          
String append(String string)
          
String prepend(CHAR string)
          
String prepend(String string)
          
String wrap(char pre, char pos)
          
bit opEquals(String string)
          Operator ==
bit opEquals(CHAR string)
          Operator ==
int opPostInc()
          Operator ++ post.
int opPostDec()
          Operator -- post.
String opCat(CHAR str)
          Concatenate an array with this String
String opCat(CHAR t)
          Concatenate a char with this String
char toString(bit b)
          
char toString(int i)
          
char toString(long i)
          
char toString(uint i)
          
char toString(ulong u)
          
char toString(ubyte ub)
          
char toString(double f)
          
String opCat(int i)
          
String opCat(uint i)
          
String opCat(ubyte ub)
          
String opCat(float f)
          
String opCat(bit b)
          
String opCat(Object object)
          
String opCatAssign(CHAR str)
          
String opCatAssign(int i)
          
String opCatAssign(double d)
          
String opCatAssign(char c)
          
String opCatAssign(Object object)
          
CHAR opIndex(int index)
          
void opIndexAssign(CHAR t, int index)
          
String opSlice(int start, int end)
          
static int wcsLen(wchar* str)
          
static int wcsCmp(wchar* str1, wchar* str2)
          
static int strLen(char* str)
          
static int strCmp(char* str1, char* str2)
          


public static this ()
/** * Creates the static variables */
public this ()
/** * Creates a new empty String. */
this (CHAR[] str)
/** * Creates a new String that contains the array passed. * The array is duplicated. * To make a string point to an existing array create an string string * and them set it with the point() method. * @param str the array that defines the initial value of this String */
this (String string)
/** * Copy constructor. * The String to copy is duplicated. * @param string The String to copy */
this (void* str)
/** * Creates a String from a pointer to memory. * The string length will be the length from the pointer until the next null char; * @param str The pointer. */
this (char* str, int length)
/** * Create a String from a pointer to chars. * @param str the pointer to chars * @param length the length of the new String */
this (char c)
/** * Creates a String from the char. * The String will a the lengh of 1 * @param c The char */
this (int i)
/** * creates a String that is the representation of the int passed. * @param i the int to be converted to String */
this (uint ui)
/** * creates a String that is the representation of the uint passed * @param ui the uint to be converted to String */
this (long l)
/** * creates a String that is the representation of the long passed * @param l the long to be converted to String */
this (double d)
/** * creates a String that is the representation of the double passed * @param d the double to be converted to String */
this (bit b)
/** * Creates a string that is "0" or "1". * This is to keep compatilility - WILL CHANGE(?) - to "false" or "true"? */
String dup()
/** * Duplicates this String. * The data array will be duplicate. * @return A new String */
static String newz(char* str)
/** * Creates a String from a zero terminated pointer to chars * We need this to interface to C style strings */
static char* stringz(char[] string)
/** * Returns pointer to a null terminated version of string passed in. * @return a null terminated version of string passed in this might or not be a copy of the original string */
char [] toString()
/** * Gets the array of characters of this String * @return the array of characters of this String */
char* toStringz()
/** * Gets a null terminated array of char version of this String * @return a null terminated array of char version of this String */
void [] toVoid()
/** * Gets this string chars as an void array * @return a null terminated array of char version of this String */
int length()
/** * Gets the length of this String * @return The length of this String */
void length(int length)
/** * Sets the length of this String * @param The new length for this String */
void incLength(int increment)
/** * Increments or decrements the length of this String. * The resulting length will never be less then zero. * @param increment The length increment */
void set(String string)
/** * Sets this String from another String. * The String array will be duplicated * @param String the String to copy */
void set(char[] str)
/** * Sets this String from an array of chars. * The array will be duplicated * @param str the array to copy */
void set(char* str, int length)
/** * Sets this String from a pointer to chars and a length. * @param str The array of chars * @param length the length to copy */
void setz(char* str)
/** * Sets this String from a pointer to chars terminated ny null. * @param str the pointer to chars */
void point(char[] str)
/** * Makes this string to point to the char array. * the date is not duplicated and is ready for changes. * be awere the D will copy the string if it will change in length breaking the paralel to the original. */
void point(void[] str)
/** * Makes this string to point to the char array. * the date is not duplicated and is ready for changes * be awere the D will copy the string if it will change in length breaking the paralel to the original. */
CHAR charAt(int index)
/** * Gets the character at the index position. * (first char is at 0) * @param index The index position * @return the character at the index position * @throws assert if index is invalid */
void print()
/////////////////////////////////////////////////////////// /// print ourselfs ///////////////////////////////////////////////////////////
void println()

void print(char[] prefix)

void println(char[] prefix)

void println(String prefix)

String substring(int start, int end)
/** * Creates a new String from a slice of this string * @param start * @param end *//////////////////////////////////////////////////////////// /// utilities that create a new String object ///////////////////////////////////////////////////////////
String substring(int start)

String stripl()

String stripr()

String strip()

static String join(String[] tokens, CHAR[] sep)

static String join(String[] tokens, String sep)

String [] split()

String [] split(String delim)

String [] split(CHAR[] delim)

static String [] sSplit(char[] s, char[] delim)

String [] splitLines()

int find(dchar c)
/////////////////////////////////////////////////////////// //non mutator utilities ///////////////////////////////////////////////////////////
bit contains(CHAR[] string)

bit contains(String string)

bit contains(CHAR c)

int find(CHAR c, int start)

int find(char[] sub, int start)

int find(String sub, int start)

int rfind(dchar c, int start)

int rfind(CHAR[] string, int start)

int rfind(String sub, int start)

String getLineText(int pos)

int countLine(int pos)
/** * counts the number of eol from the begining to pos */
bit startsWith(CHAR c)
/** * Tests c is the first chracters on the string * @param c the character to test * @return true if the string starts with the character */
bit startsWith(String string)
/** * Tests if the passed string is the begining of this string * @param string the String to test * @return true if the string starts with the character */
bit startsWith(CHAR[] string)
/** * Tests if the passed array is the begining of this string * @param string the array to test * @return true if the string starts with the character */
bit endsWith(CHAR c)

bit endsWith(String string)
// bit debugNow = false)
bit endsWith(CHAR[] string)

static int isWhite(dchar c)

bit equals(String string)

bit equalsIgnoreCase(String string)

bit equalsIgnoreCase(char[] string)

String toUpper()
/////////////////////////////////////////////////////////// /// mutator utilities ///////////////////////////////////////////////////////////
String toLower()

String replace(CHAR[] from, CHAR[] to)

String replace(CHAR[] from, String to)

String replace(String from, CHAR[] to)

String replace(String from, String to)

String replaceSlice(String slice, String replacement)

String append(char[] string)

String append(String string)

String prepend(CHAR[] string)

String prepend(String string)

String wrap(char[] pre, char[] pos)

bit opEquals(String string)
/** * Operator == * @param string the String to compare to * @return true if Strings are equal *//////////////////////////////////////////////////////////// /// operators ///////////////////////////////////////////////////////////
bit opEquals(CHAR[] string)
/** * Operator == * @param string the array to compare to * @return true if Strings are equal */
int opPostInc()
/** * Operator ++ post. * Increments the String length * @return the new String length */
int opPostDec()
/** * Operator -- post. * Decrements the String length * @return the new String length */
String opCat(CHAR[] str)
/** * Concatenate an array with this String * @param str The array to concatnate * @return a new String that is the concatenation of this String an the array received */
String opCat(CHAR t)
/** * Concatenate a char with this String * @param str The array to concatnate * @return a new String that is the concatenation of this String and the char received */
char [] toString(bit b)

char [] toString(int i)

char [] toString(long i)

char [] toString(uint i)

char [] toString(ulong u)

char [] toString(ubyte ub)

char [] toString(double f)

String opCat(int i)

String opCat(uint i)

String opCat(ubyte ub)

String opCat(float f)

String opCat(bit b)

String opCat(Object object)

String opCatAssign(CHAR[] str)

String opCatAssign(int i)

String opCatAssign(double d)

String opCatAssign(char c)

String opCatAssign(Object object)

CHAR opIndex(int index)

void opIndexAssign(CHAR t, int index)

String opSlice(int start, int end)

static int wcsLen(wchar* str)
/////////////////////////////////////////////////////////// /// get the value as other primitive types /////////////////////////////////////////////////////////// //I guess it wouldn't harm to have here toInt and toDouble /////////////////////////////////////////////////////////// /// some other /////////////////////////////////////////////////////////// //used by io.Path
static int wcsCmp(wchar* str1, wchar* str2)
//used by io.Path
static int strLen(char* str)
//used by io.Path
static int strCmp(char* str1, char* str2)
//used by io.Path