#ifndef DEF_BASICSTRING_CLASS_H #define DEF_BASICSTRING_CLASS_H #include template class Vector; template class BasicString { protected: T *m_string; u32int m_length; public: BasicString(); BasicString(const T* string, u32int length); BasicString(const BasicString &other); BasicString(const T, u32int count = 1); virtual ~BasicString(); void affect(const BasicString &other); void affect(const T* string, u32int length); void affect(const T value, u32int count = 1); void operator= (const BasicString &other) { affect(other); } bool compare(const BasicString &other) const; bool compare(const T* string, u32int length) const; bool operator== (const BasicString &other) const { return compare(other); } bool operator!= (const BasicString &other) const { return !compare(other); } BasicString& append(const BasicString &other); BasicString& append(const T* string, u32int length); BasicString& append(const T other); BasicString& operator+= (const BasicString &other) { return append(other); } BasicString& operator+= (const T other) { return append(other); } BasicString concat(const BasicString &other) const; BasicString concat(const T* string, u32int length) const; BasicString concat(const T other) const; T& operator[] (int index) const { return m_string[index]; } u32int size() const { return m_length; } void clear(); bool empty() const { return m_length == 0; } bool contains(const T& chr) const; Vector< BasicString > split(T sep) const; BasicString substr(s32int start, u32int size); }; #include "BasicString.class.cpp" #endif