|
| | JString () |
| |
| | JString (const JString &str, const Copy copy=kCopy) |
| |
| | JString (const JString &str, const JCharacterRange &range, const Copy copy=kCopy) |
| |
| | JString (const JUtf8Byte *str, const JSize byteCount, const Copy copy=kCopy) |
| |
| | JString (const JUtf8Byte *str, const JUtf8ByteRange &range, const Copy copy=kCopy) |
| |
| | JString (const JUtf8Character &c) |
| |
| | JString (const std::string &str, const JUtf8ByteRange &range) |
| |
| | JString (const bool normalize) |
| |
| | JString (const JUtf8Byte *str, const Copy copy=kCopy) |
| |
| | JString (const std::string &str) |
| |
| | JString (const JUInt64 number, const Base base=kBase10, const bool pad=false) |
| |
| | JString (const JFloat number, const JInteger precision=kPrecisionAsNeeded, const ExponentDisplay expDisplay=kStandardExponent, const JInteger exponent=0, const JInteger sigDigitCount=0) |
| |
| | ~JString () |
| |
| void * | operator new (size_t sz) noexcept |
| |
| void * | operator new (size_t size, const JUtf8Byte *file, const JUInt32 line, const int type, const bool assert) noexcept |
| |
| void * | operator new (size_t sz, const bool forceShallow) noexcept |
| |
| void | operator delete (void *memory) noexcept |
| |
| JString & | operator= (const JString &str) |
| |
| JString & | operator= (const JUtf8Byte *str) |
| |
| JString & | operator= (const std::string &str) |
| |
| JString & | operator= (const JUtf8Character &c) |
| |
| JString & | operator+= (const JString &str) |
| |
| JString & | operator+= (const JUtf8Byte *str) |
| |
| JString & | operator+= (const std::string &str) |
| |
| JString & | operator+= (const JUtf8Character &c) |
| |
| void | Set (const JString &str) |
| |
| void | Set (const JString &str, const JCharacterRange &range) |
| |
| void | Set (const JUtf8Byte *str) |
| |
| void | Set (const JUtf8Byte *str, const JSize byteCount) |
| |
| void | Set (const JUtf8Byte *str, const JUtf8ByteRange &range) |
| |
| void | Set (const std::string &str) |
| |
| void | Set (const std::string &str, const JUtf8ByteRange &range) |
| |
| void | Set (const JUtf8Character &c) |
| |
| void | Clear () |
| |
| bool | IsEmpty () const |
| |
| JSize | GetCharacterCount () const |
| |
| JSize | GetByteCount () const |
| |
| bool | CharacterIndexValid (const JIndex index) const |
| |
| bool | ByteIndexValid (const JIndex index) const |
| |
| bool | RangeValid (const JCharacterRange &range) const |
| |
| bool | RangeValid (const JUtf8ByteRange &range) const |
| |
| bool | IsAscii () const |
| |
| JUtf8Character | GetFirstCharacter () const |
| |
| JUtf8Character | GetLastCharacter () const |
| |
| const JUtf8Byte * | GetBytes () const |
| |
| JUtf8Byte * | AllocateBytes () const |
| |
| bool | IsOwner () const |
| |
| const JUtf8Byte * | GetRawBytes () const |
| |
| bool | StartsWith (const JString &str, const Case caseSensitive=kCompareCase) const |
| |
| bool | StartsWith (const JString &str, const JCharacterRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | StartsWith (const JUtf8Byte *str, const Case caseSensitive=kCompareCase) const |
| |
| bool | StartsWith (const JUtf8Byte *str, const JSize byteCount, const Case caseSensitive=kCompareCase) const |
| |
| bool | StartsWith (const JUtf8Byte *str, const JUtf8ByteRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | StartsWith (const JUtf8Character &c, const Case caseSensitive=kCompareCase) const |
| |
| bool | StartsWith (const std::string &str, const Case caseSensitive=kCompareCase) const |
| |
| bool | StartsWith (const std::string &str, const JUtf8ByteRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const JString &str, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const JString &str, const JCharacterRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const JUtf8Byte *str, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const JUtf8Byte *str, const JSize byteCount, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const JUtf8Byte *str, const JUtf8ByteRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const JUtf8Character &c, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const std::string &str, const Case caseSensitive=kCompareCase) const |
| |
| bool | Contains (const std::string &str, const JUtf8ByteRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const JString &str, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const JString &str, const JCharacterRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const JUtf8Byte *str, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const JUtf8Byte *str, const JSize byteCount, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const JUtf8Byte *str, const JUtf8ByteRange &range, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const JUtf8Character &c, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const std::string &str, const Case caseSensitive=kCompareCase) const |
| |
| bool | EndsWith (const std::string &str, const JUtf8ByteRange &range, const Case caseSensitive=kCompareCase) const |
| |
| JString | EncodeBase64 () const |
| |
| bool | DecodeBase64 (JString *str) const |
| |
| void | Read (std::istream &input, const JSize byteCount) |
| |
| void | ReadDelimited (std::istream &input) |
| |
| void | Print (std::ostream &output) const |
| |
| void | PrintHex (std::ostream &output) const |
| |
| JSize | GetMinLgSize () const |
| |
| void | SetMinLgSize (const JSize lgSize) |
| |
| void | Prepend (const JString &str) |
| |
| void | Prepend (const JUtf8Byte *str) |
| |
| void | Prepend (const JUtf8Byte *str, const JSize byteCount) |
| |
| void | Prepend (const std::string &str) |
| |
| void | Prepend (const JUtf8Character &c) |
| |
| void | Append (const JString &str) |
| |
| void | Append (const JUtf8Byte *str) |
| |
| void | Append (const JUtf8Byte *str, const JSize byteCount) |
| |
| void | Append (const std::string &str) |
| |
| void | Append (const JUtf8Character &c) |
| |
| void | TrimWhitespace () |
| |
| void | ToLower () |
| |
| void | ToUpper () |
| |
| bool | MatchCase (const JString &source, const JCharacterRange &sourceRange) |
| |
| bool | MatchCase (const JUtf8Byte *source, const JUtf8ByteRange &sourceRange) |
| |
| bool | MatchCase (const std::string &source, const JUtf8ByteRange &sourceRange) |
| |
| bool | MatchCase (const JString &source, const JCharacterRange &sourceRange, const JCharacterRange &destRange) |
| |
| bool | MatchCase (const JUtf8Byte *source, const JUtf8ByteRange &sourceRange, const JCharacterRange &destRange) |
| |
| bool | MatchCase (const std::string &source, const JUtf8ByteRange &sourceRange, const JCharacterRange &destRange) |
| |
| void | Split (const JUtf8Byte *separator, JPtrArray< JString > *partList, const JSize limit=0, const bool includeSeparators=false) const |
| |
| void | Split (const JString &separator, JPtrArray< JString > *partList, const JSize limit=0, const bool includeSeparators=false) const |
| |
| void | Split (const JRegex &separator, JPtrArray< JString > *partList, const JSize limit=0, const bool includeSeparators=false) const |
| |
| bool | IsFloat () const |
| |
| bool | ConvertToFloat (JFloat *value) const |
| |
| bool | IsInteger (const JSize base=10) const |
| |
| bool | ConvertToInteger (JInteger *value, const JSize base=10) const |
| |
| bool | IsUInt (const JSize base=10) const |
| |
| bool | IsHexValue () const |
| |
| bool | ConvertToUInt (JUInt *value, const JSize base=10) const |
| |
|
| static bool | IsFloat (const JUtf8Byte *str) |
| |
| static bool | IsFloat (const JUtf8Byte *str, const JSize byteCount) |
| |
| static bool | ConvertToFloat (const JUtf8Byte *str, JFloat *value) |
| |
| static bool | ConvertToFloat (const JUtf8Byte *str, const JSize byteCount, JFloat *value) |
| |
| static bool | IsInteger (const JUtf8Byte *str, const JSize base=10) |
| |
| static bool | IsInteger (const JUtf8Byte *str, const JSize byteCount, const JSize base) |
| |
| static bool | ConvertToInteger (const JUtf8Byte *str, JInteger *value, const JSize base=10) |
| |
| static bool | ConvertToInteger (const JUtf8Byte *str, const JSize byteCount, JInteger *value, const JSize base=10) |
| |
| static bool | IsUInt (const JUtf8Byte *str, const JSize base=10) |
| |
| static bool | IsUInt (const JUtf8Byte *str, const JSize byteCount, const JSize base) |
| |
| static bool | IsHexValue (const JUtf8Byte *str) |
| |
| static bool | IsHexValue (const JUtf8Byte *str, const JSize byteCount) |
| |
| static bool | ConvertToUInt (const JUtf8Byte *str, JUInt *value, const JSize base=10) |
| |
| static bool | ConvertToUInt (const JUtf8Byte *str, const JSize byteCount, JUInt *value, const JSize base=10) |
| |
| static bool | IsEmpty (const JUtf8Byte *s) |
| |
| static bool | IsEmpty (const JString *s) |
| |
| static bool | IsValid (const JUtf8Byte *s) |
| |
| static bool | IsValid (const JUtf8Byte *s, const JUtf8ByteRange &range) |
| |
| static JSize | CountCharacters (const JUtf8Byte *str) |
| |
| static JSize | CountCharacters (const JUtf8Byte *str, const JSize byteCount) |
| |
| static JSize | CountCharacters (const JUtf8Byte *str, const JUtf8ByteRange &range) |
| |
| static JSize | CountBytes (const JUtf8Byte *str, const JSize characterCount) |
| |
| static bool | CountBytesBackward (const JUtf8Byte *str, const JSize byteOffset, const JSize characterCount, JSize *byteCount) |
| |
| static JUtf8ByteRange | CharacterToUtf8ByteRange (const JUtf8Byte *str, const JCharacterRange &range) |
| |
| static int | Compare (const JString &s1, const JString &s2, const Case caseSensitive=kCompareCase) |
| |
| static int | Compare (const JString &s1, const JUtf8Byte *s2, const Case caseSensitive=kCompareCase) |
| |
| static int | Compare (const JUtf8Byte *s1, const JString &s2, const Case caseSensitive=kCompareCase) |
| |
| static int | Compare (const JUtf8Byte *s1, const JUtf8Byte *s2, const Case caseSensitive=kCompareCase) |
| |
| static int | Compare (const JString &s1, const std::string &s2, const Case caseSensitive=kCompareCase) |
| |
| static int | Compare (const std::string &s1, const JString &s2, const Case caseSensitive=kCompareCase) |
| |
| static int | Compare (const JUtf8Byte *s1, const JSize byteCount1, const JUtf8Byte *s2, const JSize byteCount2, const Case caseSensitive=kCompareCase) |
| |
| static int | CompareMaxNBytes (const JUtf8Byte *s1, const JUtf8Byte *s2, const JSize N, const Case caseSensitive=kCompareCase) |
| |
| static JSize | CalcCharacterMatchLength (const JString &s1, const JString &s2, const Case caseSensitive=kCompareCase) |
| |
| static JSize | Normalize (const JUtf8Byte *source, const JSize byteCount, JUtf8Byte **destination) |
| |
| static JSize | CopyNormalizedBytes (const JUtf8Byte *source, const JSize maxBytes, JUtf8Byte *destination, const JSize capacity) |
| |
This class was not designed to be a base class! If you need to override it,
be sure to make the destructor virtual.
Note that operator== is case sensitive, as one would expect. To avoid the
UNIX method of sorting capitalized names separately in front of lowercase
names, operator< and operator> are not case sensitive. One should therefore
not mix == with < and > when comparing strings.
Since stringstream doesn't provide the control we need when converting a number
to a string, we use the NumConvert and StrUtil modules. We include them at
the end of the file so they are completely hidden and JString is self-contained.
By default, JString normalizes all text, so comparing strings is sane.
In certain cases, however, this behavior is not desirable, e.g., when
the string contains nullptr. The default constructor accepts an optional
"normalize" flag to disable normalization. This can only be set in the
constructor and cannot be changed afterwards.