39#ifndef BLOCXX_STRING_HPP_INCLUDE_GUARD_
40#define BLOCXX_STRING_HPP_INCLUDE_GUARD_
41#include "blocxx/BLOCXX_config.h"
89#if defined(BLOCXX_INT32_IS_INT) && defined(BLOCXX_INT64_IS_LONG_LONG)
103 explicit String(
unsigned long val);
219 char* allocateCString()
const;
223 size_t length()
const;
227 size_t size()
const {
return length(); }
233 size_t UTF8Length()
const;
237 bool empty()
const {
return length() == 0; }
246 int format(
const char*
fmt, ...);
257 E_RETURN_EMPTY_TOKENS
279 const char* c_str()
const;
284 BLOCXX_DEPRECATED
const char*
getBytes()
const {
return c_str(); }
291 char charAt(
size_t ndx)
const;
307 int compareTo(
const char*
arg)
const;
315 int compareToIgnoreCase(
const String&
arg)
const;
323 int compareToIgnoreCase(
const char*
arg)
const;
338 return concat(
arg.c_str());
360 bool endsWith(
const char*
arg, EIgnoreCaseFlag
ignoreCase = E_CASE_SENSITIVE)
const;
382 bool endsWith(
char arg)
const;
399 bool equals(
const char*
arg)
const;
408 bool equalsIgnoreCase(
const String&
arg)
const;
417 bool equalsIgnoreCase(
const char*
arg)
const;
438 size_t indexOf(
const char*
arg,
size_t fromIndex=0)
const;
459 size_t lastIndexOf(
char ch,
size_t fromIndex=npos)
const;
468 size_t lastIndexOf(
const char*
arg,
size_t fromIndex=npos)
const;
490 bool startsWith(
const char*
arg, EIgnoreCaseFlag
ignoreCase = E_CASE_SENSITIVE)
const;
509 bool startsWith(
char arg)
const;
520 size_t length=npos)
const;
525 bool isSpaces()
const;
586 const char& operator[] (
size_t ndx)
const;
587 char& operator[] (
size_t ndx);
615 void readObject(std::streambuf &
istrm);
621 void writeObject(std::streambuf &
ostrm)
const;
692 unsigned int toUnsignedInt(
int base=10)
const;
739#if defined(BLOCXX_AIX)
740 static const size_t npos;
746#pragma warning (push)
747#pragma warning (disable: 4251)
771 return (
s1.compareTo(
s2) == 0);
786 return (
s1.compareTo(
s2) != 0);
801 return (
s1.compareTo(
s2) < 0);
811 return (
String(
p).compareTo(s) < 0);
816 return (
s1.compareTo(
s2) <= 0);
826 return (
String(
p).compareTo(s) <= 0);
831 return (
s1.compareTo(
s2) > 0);
841 return (
String(
p).compareTo(s) > 0);
846 return (
s1.compareTo(
s2) >= 0);
856 return (
String(
p).compareTo(s) >= 0);
#define BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
Array<> wraps std::vector<> in COWReference<> adding ref counting and copy on write capability.
The Bool class is an abstraction for the boolean data type.
COWIntrusiveReference A smart pointer that uses intrusive reference counting.
The Char16 class is an abstraction for a double byte character.
This String class is an abstract data type that represents as NULL terminated string of characters.
bool startsWith(const String &arg, EIgnoreCaseFlag ignoreCase=E_CASE_SENSITIVE) const
Determine if this String object starts with a given substring.
bool endsWith(const String &arg, EIgnoreCaseFlag ignoreCase=E_CASE_SENSITIVE) const
Determine if this String object ends with the same string represented by another String object.
String & concat(const String &arg)
Append another String object to this String object.
size_t indexOf(const String &arg, size_t fromIndex=0) const
Find the first occurence of a string in this String object.
size_t lastIndexOf(const String &arg, size_t fromIndex=npos) const
Find the last occurence of a string in this String object.
BLOCXX_DEPRECATED const char * getBytes() const
DEPRECATED in favor of c_str() in 3.1.0.
COWIntrusiveReference< ByteBuf > buf_t
int compareTo(const String &arg) const
Compare another String object with this one.
Char16 operator+(const Char16 &arg1, const Char16 &arg2)
bool operator<(const Array< T > &x, const Array< T > &y)
bool operator<=(const Array< T > &x, const Array< T > &y)
Determine if one Array is less than or equal to another.
bool operator>(const Array< T > &x, const Array< T > &y)
Determine if one Array is greater than another.
bool operator==(const Array< T > &x, const Array< T > &y)
ostream & operator<<(ostream &ostrm, const Bool &arg)
bool operator>=(const Array< T > &x, const Array< T > &y)
Determine if one Array is greater than or equal to another.
BLOCXX_EXPORT_TEMPLATE(BLOCXX_COMMON_API, Array, Bool)
bool operator!=(const Array< T > &x, const Array< T > &y)
Determine two Arrays are not equal.
void swap(Array< T > &x, Array< T > &y)