22#ifndef TITANIC_TT_STRING_H
23#define TITANIC_TT_STRING_H
25#include "titanic/support/string.h"
36 TTstringData(
const char *str) : _string(str), _referenceCount(1) {}
41 SS_VALID = 0, SS_1 = 1, SS_2 = 2, SS_3 = 3, SS_4 = 4,
42 SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13
48 TTstringStatus _status;
57 void operator=(
const CString &str);
58 void operator=(
const char *str);
59 TTstring &operator+=(
const char *str);
62 bool operator==(
const TTstring &str)
const;
63 bool operator==(
const char *str)
const;
65 const char &operator[](
int index) {
66 return *(
c_str() + index);
70 return _data->_string.empty();
73 char firstChar()
const {
74 return _data->_string.firstChar();
77 char lastChar()
const {
78 return _data->_string.lastChar();
82 return _data->_string.size();
85 void deleteLastChar() {
89 bool hasPrefix(
const CString &str)
const {
90 return _data->_string.hasPrefix(str);
92 bool hasPrefix(
const char *str)
const {
93 return _data->_string.hasPrefix(str);
95 bool hasSuffix(
const CString &str)
const {
96 return _data->_string.hasSuffix(str);
98 bool hasSuffix(
const char *str)
const {
99 return _data->_string.hasSuffix(str);
102 bool contains(
const char *s)
const {
103 return _data->_string.contains(s);
117 return _status == SS_VALID;
128 const char *
c_str()
const {
return _data->_string.c_str(); }
133 operator const char *()
const {
return c_str(); }
149 return !strncmp(
c_str() + index, str, strlen(str));
void deleteLastChar()
Definition: str-base.h:142
Definition: simple_file.h:49
Definition: tt_string.h:45
void save(SimpleFile *file) const
bool isValid() const
Definition: tt_string.h:116
char charAt(int index) const
Definition: tt_string.h:138
TTstring * copy() const
Definition: tt_string.h:109
const char * c_str() const
Definition: tt_string.h:128
TTstring tokenize(const char *delim)
int deletePrefix(int count)
TTstringStatus getStatus() const
Definition: tt_string.h:123
bool compareAt(int index, const char *str) const
Definition: tt_string.h:148
int deleteSuffix(int count)
Definition: tt_string.h:31