PCL
pcl::String Class Reference

Unicode (UTF-16) string. More...

#include <String.h>

+ Inheritance diagram for pcl::String:

Public Types

typedef string_base::allocator allocator
 
typedef string_base::block_allocator block_allocator
 
typedef string_base::c_string c_string
 
typedef string8_base::c_string c_string8
 
typedef string8_base::iterator char8_iterator
 
typedef string8_base::char_traits char8_traits
 
typedef string8_base::char_type char8_type
 
typedef string_base::char_traits char_traits
 
typedef string_base::char_type char_type
 
typedef string_base::const_c_string const_c_string
 
typedef string8_base::const_c_string const_c_string8
 
typedef string8_base::const_iterator const_char8_iterator
 
typedef string_base::const_iterator const_iterator
 
typedef string_base::const_reverse_iterator const_reverse_iterator
 
typedef string_base::iterator iterator
 
typedef string_base::reverse_iterator reverse_iterator
 
typedef GenericString< char, IsoCharTraits, StandardAllocatorstring8_base
 
typedef GenericString< char16_type, CharTraits, StandardAllocatorstring_base
 
- Public Types inherited from pcl::GenericString< char16_type, CharTraits, StandardAllocator >
typedef pcl::Allocator< char16_type, StandardAllocatorallocator
 
typedef StandardAllocator block_allocator
 
typedef char16_typec_string
 
typedef CharTraits char_traits
 
typedef char16_type char_type
 
typedef const char16_typeconst_c_string
 
typedef const char16_typeconst_iterator
 
typedef ReverseRandomAccessIterator< const_iterator, const char16_typeconst_reverse_iterator
 
typedef char16_typeiterator
 
typedef ReverseRandomAccessIterator< iterator, char16_typereverse_iterator
 

Public Member Functions

 String ()
 
 String (const string_base &s)
 
 String (const String &s)
 
 String (string_base &&s)
 
 String (String &&s)
 
 String (const string8_base &s)
 
 String (const_iterator t)
 
 String (const_iterator t, size_type i, size_type n)
 
 String (char_type c, size_type n)
 
 String (const_iterator i, const_iterator j)
 
 String (std::initializer_list< char_type > l)
 
 String (const char16_t *t)
 
 String (const char16_t *t, size_type i, size_type n)
 
 String (char16_t c, size_type n)
 
 String (const wchar_t *t)
 
 String (const wchar_t *t, size_type i, size_type n)
 
 String (wchar_t c, size_type n)
 
 String (const_c_string8 t)
 
 String (const_c_string8 t, size_type i, size_type n)
 
 String (const_char8_iterator i, const_char8_iterator j)
 
 String (std::initializer_list< char8_type > l)
 
 String (char8_type c, size_type n=1)
 
 String (bool x)
 
 String (short x)
 
 String (unsigned short x)
 
 String (int x)
 
 String (unsigned int x)
 
 String (long x)
 
 String (unsigned long x)
 
 String (long long x)
 
 String (unsigned long long x)
 
 String (float x)
 
 String (double x)
 
 String (long double x)
 
 String (Complex< float > &x)
 
 String (Complex< double > &x)
 
 String (Complex< long double > &x)
 
StringAppendFormat (const_c_string8 fmt,...)
 
StringAppendFormat (const wchar_t *fmt,...)
 
int AppendVFormat (const_c_string8 fmt, va_list paramList)
 
int AppendVFormat (const wchar_t *fmt, va_list paramList)
 
void Assign (const String &s)
 
void Assign (const String &s, size_type i, size_type n)
 
void Assign (const_iterator t)
 
void Assign (const_iterator i, const_iterator j)
 
void Assign (std::initializer_list< char_type > l)
 
void Assign (const_iterator t, size_type i, size_type n)
 
void Assign (char_type c, size_type n=1)
 
void Assign (const char16_t *t)
 
void Assign (const char16_t *t, size_type i, size_type n)
 
void Assign (char16_t c, size_type n=1)
 
void Assign (const wchar_t *t)
 
void Assign (const wchar_t *t, size_type i, size_type n)
 
void Assign (wchar_t c, size_type n=1)
 
void Assign (const string8_base &s)
 
void Assign (const_c_string8 t)
 
void Assign (const_c_string8 t, size_type i, size_type n)
 
void Assign (const_char8_iterator p, const_char8_iterator q)
 
void Assign (std::initializer_list< char8_type > l)
 
void Assign (char8_type c, size_type n=1)
 
String DecodedHTMLSpecialChars () const
 
String EncodedHTMLSpecialChars () const
 
StringFormat (const_c_string8 fmt,...)
 
StringFormat (const wchar_t *fmt,...)
 
Stringoperator= (const String &s)
 
Stringoperator= (String &&s)
 
Stringoperator= (const string_base &s)
 
Stringoperator= (string_base &&s)
 
Stringoperator= (const string8_base &s)
 
Stringoperator= (const_iterator t)
 
Stringoperator= (char_type c)
 
Stringoperator= (const char16_t *t)
 
Stringoperator= (char16_t c)
 
Stringoperator= (const wchar_t *t)
 
Stringoperator= (wchar_t c)
 
Stringoperator= (const_c_string8 t)
 
Stringoperator= (char8_type c)
 
void ParseISO8601DateTime (int &year, int &month, int &day, double &dayf, double &tz) const
 
void ParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const String &separator=':') const
 
void ParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const
 
double SexagesimalToDouble (const String &separator=':') const
 
double SexagesimalToDouble (const Array< char_type > &separators) const
 
IsoString To7BitASCII () const
 
bool ToBool () const
 
template<class C >
StringToColonSeparated (const C &c)
 
template<class C >
StringToCommaSeparated (const C &c)
 
StringToDecodedHTMLSpecialChars ()
 
double ToDouble () const
 
StringToEncodedHTMLSpecialChars ()
 
float ToFloat () const
 
template<class C >
StringToHyphenated (const C &c)
 
long ToInt () const
 
long ToInt (int base) const
 
long long ToInt64 () const
 
long long ToInt64 (int base) const
 
IsoString ToIsoString () const
 
IsoString ToLocal8Bit () const
 
IsoString ToMBS () const
 
template<class C >
StringToNewLineSeparated (const C &c)
 
template<class C >
StringToNullSeparated (const C &c)
 
template<class C >
StringToSeparated (const C &c, char_type separator)
 
template<class C , class AF >
StringToSeparated (const C &c, char_type separator, AF append)
 
template<class C >
StringToSeparated (const C &c, const String &separator)
 
template<class C , class AF >
StringToSeparated (const C &c, const String &separator, AF append)
 
template<class C >
StringToSeparated (const C &c, const_c_string separator)
 
template<class C , class AF >
StringToSeparated (const C &c, const_c_string separator, AF append)
 
template<class C >
StringToSeparated (const C &c, const_c_string8 separator)
 
template<class C , class AF >
StringToSeparated (const C &c, const_c_string8 separator, AF append)
 
template<class C >
StringToSpaceSeparated (const C &c)
 
template<class C >
StringToTabSeparated (const C &c)
 
unsigned long ToUInt () const
 
unsigned long ToUInt (int base) const
 
unsigned long long ToUInt64 () const
 
unsigned long long ToUInt64 (int base) const
 
Array< uint32ToUTF32 (size_type i=0, size_type n=maxPos) const
 
IsoString ToUTF8 (size_type i=0, size_type n=maxPos) const
 
Array< wchar_t > ToWCharArray (size_type i=0, size_type n=maxPos) const
 
bool TryParseISO8601DateTime (int &year, int &month, int &day, double &dayf, double &tz) const
 
bool TryParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const String &separator=':') const
 
bool TryParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const
 
bool TrySexagesimalToDouble (double &value, const String &separator=':') const
 
bool TrySexagesimalToDouble (double &value, const Array< char_type > &separators) const
 
bool TryToBool (bool &value) const
 
bool TryToDouble (double &value) const
 
bool TryToFloat (float &value) const
 
bool TryToInt (int &value) const
 
bool TryToInt (int &value, int base) const
 
bool TryToInt64 (long long &value) const
 
bool TryToInt64 (long long &value, int base) const
 
bool TryToUInt (unsigned &value) const
 
bool TryToUInt (unsigned &value, int base) const
 
bool TryToUInt64 (unsigned long long &value) const
 
bool TryToUInt64 (unsigned long long &value, int base) const
 
int VFormat (const_c_string8 fmt, va_list paramList)
 
int VFormat (const wchar_t *fmt, va_list paramList)
 
- Public Member Functions inherited from pcl::GenericString< char16_type, CharTraits, StandardAllocator >
 GenericString ()
 
 GenericString (const GenericString &s)
 
 GenericString (GenericString &&s)
 
 GenericString (const_c_string t)
 
 GenericString (const_iterator i, const_iterator j)
 
 GenericString (std::initializer_list< char_type > l)
 
 GenericString (const_c_string t, size_type i, size_type n)
 
 GenericString (char_type c, size_type n=1)
 
 ~GenericString ()
 
void Add (const GenericString< char16_type, R1, A1 > &s)
 
void Add (const_iterator i, const_iterator j)
 
void Add (const_c_string t, size_type n)
 
void Add (const_c_string t)
 
void Add (char_type c, size_type n=1)
 
void Append (const GenericString< char16_type, R1, A1 > &s)
 
void Append (const_iterator i, const_iterator j)
 
void Append (const_c_string t, size_type n)
 
void Append (const_c_string t)
 
void Append (char_type c, size_type n=1)
 
void Assign (const GenericString &s)
 
void Assign (const GenericString &s, size_type i, size_type n)
 
void Assign (const_c_string t)
 
void Assign (const_iterator i, const_iterator j)
 
void Assign (std::initializer_list< char_type > l)
 
void Assign (const_c_string t, size_type i, size_type n)
 
void Assign (char_type c, size_type n=1)
 
iterator At (size_type i)
 
const_iterator At (size_type i) const
 
size_type Available () const
 
iterator Begin ()
 
const_iterator Begin () const
 
iterator begin ()
 
const_iterator begin () const
 
size_type Break (C &list, const GenericString< char16_type, R1, A1 > &s, bool trim=false, size_type i=0) const
 
size_type Break (C &list, const_c_string s, bool trim=false, size_type i=0) const
 
size_type Break (C &list, char_type c, bool trim=false, size_type i=0) const
 
size_type Break (C &list, const Array< S > &ca, bool trim=false, size_type i=0) const
 
size_type BreakIC (C &list, const GenericString< char16_type, R1, A1 > &s, bool trim=false, size_type i=0) const
 
size_type BreakIC (C &list, const_c_string s, bool trim=false, size_type i=0) const
 
size_type BreakIC (C &list, char_type c, bool trim=false, size_type i=0) const
 
void c_copy (iterator dst, size_type maxCharsToCopy, size_type i=0) const
 
const_c_string c_str () const
 
size_type Capacity () const
 
GenericString CaseFolded () const
 
GenericString CenterJustified (size_type width, char_type fill=CharTraits ::Blank()) const
 
void Clear ()
 
int Compare (const GenericString< char16_type, R1, A1 > &s, bool caseSensitive=true, bool localeAware=true) const
 
int Compare (const_c_string t, bool caseSensitive=true, bool localeAware=true) const
 
int Compare (char_type c, bool caseSensitive=true, bool localeAware=true) const
 
int CompareCodePoints (const GenericString< char16_type, R1, A1 > &s, bool caseSensitive=true) const
 
int CompareCodePoints (const_c_string t, bool caseSensitive=true) const
 
int CompareCodePoints (char_type c, bool caseSensitive=true) const
 
int CompareIC (const GenericString< char16_type, R1, A1 > &s, bool localeAware=true) const
 
int CompareIC (const_c_string t, bool localeAware=true) const
 
int CompareIC (char_type c, bool localeAware=true) const
 
bool Contains (const GenericString< char16_type, R1, A1 > &s) const
 
bool Contains (const_c_string t) const
 
bool Contains (char_type c) const
 
bool ContainsIC (const GenericString< char16_type, R1, A1 > &s) const
 
bool ContainsIC (const_c_string t) const
 
bool ContainsIC (char_type c) const
 
void Delete (size_type i, size_type n=1)
 
void DeleteChar (char_type c, size_type i=0)
 
void DeleteCharIC (char_type c, size_type i=0)
 
void DeleteLeft (size_type i)
 
void DeleteRight (size_type i)
 
void DeleteString (const GenericString< char16_type, R1, A1 > &s, size_type i=0)
 
void DeleteString (const_c_string t, size_type i=0)
 
void DeleteStringIC (const GenericString< char16_type, R1, A1 > &s, size_type i=0)
 
void DeleteStringIC (const_c_string t, size_type i=0)
 
GenericString DoubleQuoted () const
 
GenericString Enclosed (char_type c) const
 
iterator End ()
 
const_iterator End () const
 
iterator end ()
 
const_iterator end () const
 
bool EndsWith (const GenericString< char16_type, R1, A1 > &s) const
 
bool EndsWith (const_c_string t) const
 
bool EndsWith (char_type c) const
 
bool EndsWithIC (const GenericString< char16_type, R1, A1 > &s) const
 
bool EndsWithIC (const_c_string t) const
 
bool EndsWithIC (char_type c) const
 
void EnsureDoubleQuoted ()
 
void EnsureEnclosed (char_type c)
 
void EnsureSingleQuoted ()
 
void EnsureUnique ()
 
void Fill (char_type c)
 
void Fill (char_type c, size_type i, size_type n=maxPos)
 
size_type Find (const GenericString< char16_type, R1, A1 > &s, size_type i=0) const
 
size_type Find (const_c_string t, size_type i=0) const
 
size_type Find (char_type c, size_type i=0) const
 
size_type FindFirst (const GenericString< char16_type, R1, A1 > &s, size_type i=0) const
 
size_type FindFirst (const_c_string t, size_type i=0) const
 
size_type FindFirst (char_type c, size_type i=0) const
 
size_type FindFirstIC (const GenericString< char16_type, R1, A1 > &s, size_type i=0) const
 
size_type FindFirstIC (const_c_string t, size_type i=0) const
 
size_type FindFirstIC (char_type c, size_type i=0) const
 
size_type FindIC (const GenericString< char16_type, R1, A1 > &s, size_type i=0) const
 
size_type FindIC (const_c_string t, size_type i=0) const
 
size_type FindIC (char_type c, size_type i=0) const
 
size_type FindLast (const GenericString< char16_type, R1, A1 > &s, size_type r=maxPos) const
 
size_type FindLast (const_c_string t, size_type r=maxPos) const
 
size_type FindLast (char_type c, size_type r=maxPos) const
 
size_type FindLastIC (const GenericString< char16_type, R1, A1 > &s, size_type r=maxPos) const
 
size_type FindLastIC (const_c_string t, size_type r=maxPos) const
 
size_type FindLastIC (char_type c, size_type r=maxPos) const
 
char_type FirstChar () const
 
const allocatorGetAllocator () const
 
uint64 Hash (uint64 seed=0) const
 
uint32 Hash32 (uint32 seed=0) const
 
uint64 Hash64 (uint64 seed=0) const
 
bool HasWildcards () const
 
size_type IndexAt (const_iterator i) const
 
void Insert (size_type i, const GenericString< char16_type, R1, A1 > &s)
 
void Insert (size_type i, const_iterator p, const_iterator q)
 
void Insert (size_type i, const_c_string t)
 
void Insert (size_type i, const_c_string t, size_type n)
 
void Insert (size_type i, char_type c, size_type n=1)
 
bool IsAliasOf (const GenericString &s) const
 
bool IsEmpty () const
 
bool IsNumeral () const
 
bool IsSymbol () const
 
bool IsUnique () const
 
bool IsValid () const
 
bool IsValidIdentifier (distance_type &pos) const
 
bool IsValidIdentifier () const
 
void JustifyCenter (size_type width, char_type fill=CharTraits ::Blank())
 
void JustifyLeft (size_type width, char_type fill=CharTraits ::Blank())
 
void JustifyRight (size_type width, char_type fill=CharTraits ::Blank())
 
char_type LastChar () const
 
GenericString Left (size_type n) const
 
GenericString LeftJustified (size_type width, char_type fill=CharTraits ::Blank()) const
 
size_type Length () const
 
size_type LowerBound () const
 
GenericString Lowercase () const
 
char_typeoperator* ()
 
char_type operator* () const
 
GenericStringoperator+= (const GenericString< char16_type, R1, A1 > &s)
 
GenericStringoperator+= (const_c_string t)
 
GenericStringoperator+= (char_type c)
 
GenericStringoperator-= (const GenericString< char16_type, R1, A1 > &s)
 
GenericStringoperator-= (const_c_string t)
 
GenericStringoperator-= (char_type c)
 
GenericStringoperator= (const GenericString &s)
 
GenericStringoperator= (GenericString &&s)
 
GenericStringoperator= (const_c_string t)
 
GenericStringoperator= (char_type c)
 
char_typeoperator[] (size_type i)
 
char_type operator[] (size_type i) const
 
GenericString Prefix (size_type i) const
 
void Prepend (const GenericString< char16_type, R1, A1 > &s)
 
void Prepend (const_iterator i, const_iterator j)
 
void Prepend (const_c_string t, size_type n)
 
void Prepend (const_c_string t)
 
void Prepend (char_type c, size_type n=1)
 
c_string Release ()
 
void Replace (size_type i, size_type n, const GenericString< char16_type, R1, A1 > &s)
 
void Replace (size_type i, size_type n, const_c_string t)
 
void Replace (size_type i, size_type n, char_type c, size_type nc=1)
 
void ReplaceChar (char_type c1, char_type c2, size_type i=0, size_type n=maxPos)
 
void ReplaceCharIC (char_type c1, char_type c2, size_type i=0, size_type n=maxPos)
 
void ReplaceString (const GenericString< char16_type, R1, A1 > &s1, const GenericString< char16_type, R2, A2 > &s2, size_type i=0)
 
void ReplaceString (const_c_string t1, const_c_string t2, size_type i=0)
 
void ReplaceStringIC (const GenericString< char16_type, R1, A1 > &s1, const GenericString< char16_type, R2, A2 > &s2, size_type i=0)
 
void ReplaceStringIC (const_c_string t1, const_c_string t2, size_type i=0)
 
void Reserve (size_type n)
 
GenericString ResizedToNullTerminated () const
 
void ResizeToNullTerminated ()
 
void Reverse ()
 
reverse_iterator ReverseBegin ()
 
const_reverse_iterator ReverseBegin () const
 
GenericString Reversed () const
 
reverse_iterator ReverseEnd ()
 
const_reverse_iterator ReverseEnd () const
 
GenericString Right (size_type n) const
 
GenericString RightJustified (size_type width, char_type fill=CharTraits ::Blank()) const
 
void SecureFill (char c='\0')
 
void SetAllocator (const allocator &a)
 
void SetLength (size_type n)
 
GenericString SetToLength (size_type n) const
 
GenericString SingleQuoted () const
 
size_type Size () const
 
void Sort ()
 
void Sort (BP p)
 
GenericString Sorted () const
 
GenericString Sorted (BP p) const
 
void Squeeze ()
 
GenericString Squeezed () const
 
bool StartsWith (const GenericString< char16_type, R1, A1 > &s) const
 
bool StartsWith (const_c_string t) const
 
bool StartsWith (char_type c) const
 
bool StartsWithIC (const GenericString< char16_type, R1, A1 > &s) const
 
bool StartsWithIC (const_c_string t) const
 
bool StartsWithIC (char_type c) const
 
GenericString Substring (size_type i, size_type n=maxPos) const
 
GenericString Suffix (size_type i) const
 
void Swap (GenericString &s)
 
void ToCaseFolded ()
 
void ToLowercase ()
 
void ToUppercase ()
 
void Transfer (GenericString &s)
 
void Transfer (GenericString &&s)
 
void Trim ()
 
void TrimLeft ()
 
GenericString Trimmed () const
 
GenericString TrimmedLeft () const
 
GenericString TrimmedRight () const
 
void TrimRight ()
 
void Unquote ()
 
GenericString Unquoted () const
 
size_type UpperBound () const
 
GenericString Uppercase () const
 
bool WildMatch (const GenericString< char16_type, R1, A1 > &pattern, bool caseSensitive=true) const
 
bool WildMatch (const_c_string pattern, bool caseSensitive=true) const
 
bool WildMatchIC (const GenericString< char16_type, R1, A1 > &pattern) const
 
bool WildMatchIC (const_c_string pattern) const
 

Static Public Member Functions

static String CurrentLocalISO8601DateTime (const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
 
static String CurrentUTCISO8601DateTime (const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
 
static String Random (size_type n, RandomizationOptions options=RandomizationOption::Default)
 
static String ToISO8601DateTime (int year, int month, int day, double dayf, double tz=0, const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
 
static String ToSexagesimal (int sign, double s1, double s2, double s3, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
 
static String ToSexagesimal (double d, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
 
static Array< uint32UTF16ToUTF32 (const_c_string string, size_type i=0, size_type n=maxPos)
 
static IsoString UTF16ToUTF8 (const_c_string string, size_type i=0, size_type n=maxPos)
 
static String UTF32ToUTF16 (const uint32 *string, size_type i=0, size_type n=maxPos)
 
static String UTF8ToUTF16 (const_c_string8 string, size_type i=0, size_type n=maxPos)
 
static String UUID ()
 
- Static Public Member Functions inherited from pcl::GenericString< char16_type, CharTraits, StandardAllocator >
static size_type BytesPerChar ()
 
static size_type DeleteFreeList ()
 

Additional Inherited Members

- Static Public Attributes inherited from pcl::GenericString< char16_type, CharTraits, StandardAllocator >
static const size_type maxPos
 
static const size_type notFound
 

Detailed Description

String derives from an instantiation of GenericString for char16_type. It represents a dynamic string of characters in 16-bit Unicode Transformation Format (UTF-16) on the PixInsight platform.

See also
IsoString

Definition at line 7911 of file String.h.

Member Typedef Documentation

◆ allocator

The allocator class used by this template instantiation.

Definition at line 7939 of file String.h.

◆ block_allocator

The block allocator used by this template instantiation.

Definition at line 7934 of file String.h.

◆ c_string

Null-terminated sequence of UTF-16 characters.

Definition at line 7944 of file String.h.

◆ c_string8

Null-terminated sequence of 8-bit characters.

Definition at line 8004 of file String.h.

◆ char8_iterator

8-bit string iterator.

Definition at line 8014 of file String.h.

◆ char8_traits

8-bit character traits class.

Definition at line 7999 of file String.h.

◆ char8_type

Represents an 8-bit character (ISO/IEC-8859-1, ASCII or UTF-8).

Definition at line 7994 of file String.h.

◆ char_traits

The character traits class used by this template instantiation.

Definition at line 7929 of file String.h.

◆ char_type

Represents a character pertaining to a String object.

Definition at line 7924 of file String.h.

◆ const_c_string

Immutable null-terminated sequence of UTF-16 characters.

Definition at line 7949 of file String.h.

◆ const_c_string8

Immutable null-terminated sequence of 8-bit characters.

Definition at line 8009 of file String.h.

◆ const_char8_iterator

Immutable 8-bit string iterator.

Definition at line 8019 of file String.h.

◆ const_iterator

Immutable String iterator.

Definition at line 7969 of file String.h.

◆ const_reverse_iterator

Immutable reverse String iterator.

Definition at line 7979 of file String.h.

◆ iterator

String iterator.

Definition at line 7964 of file String.h.

◆ reverse_iterator

Reverse String iterator.

Definition at line 7974 of file String.h.

◆ string8_base

Represents an 8-bit string. Depending on the context, this type represents a sequence of ISO/IEC-8859-1, ASCII, or UTF-8 code points.

Note
This type must be defined as the same template instantiation used for the IsoString class.

Definition at line 7989 of file String.h.

◆ string_base

Base class of String.

Definition at line 7919 of file String.h.

Constructor & Destructor Documentation

◆ String() [1/37]

pcl::String::String ( )
inline

Constructs an empty String object.

Definition at line 8026 of file String.h.

◆ String() [2/37]

pcl::String::String ( const string_base s)
inline

Constructs a String object as a copy of the specified string_base string s (copy constructor from the base class).

Definition at line 8034 of file String.h.

◆ String() [3/37]

pcl::String::String ( const String s)
inline

Copy constructor.

Definition at line 8041 of file String.h.

◆ String() [4/37]

pcl::String::String ( string_base &&  s)
inline

Constructs a String object by transferring data from the specified string_base string s (move constructor from the base class).

Definition at line 8049 of file String.h.

◆ String() [5/37]

pcl::String::String ( String &&  s)
inline

Move constructor.

Definition at line 8056 of file String.h.

◆ String() [6/37]

pcl::String::String ( const string8_base s)
inline

Constructs a String as a transformed copy of the specified 8-bit, ISO/IEC-8859-1 string s.

Definition at line 8064 of file String.h.

◆ String() [7/37]

pcl::String::String ( const_iterator  t)
inline

Constructs a String as a copy of a null-terminated string t.

Definition at line 8072 of file String.h.

◆ String() [8/37]

pcl::String::String ( const_iterator  t,
size_type  i,
size_type  n 
)
inline

Constructs a String with the n first characters of the null-terminated string t, starting from its i-th character.

Definition at line 8080 of file String.h.

◆ String() [9/37]

pcl::String::String ( char_type  c,
size_type  n 
)
inline

Constructs a String with n copies of a UTF-16 character c.

Definition at line 8087 of file String.h.

◆ String() [10/37]

pcl::String::String ( const_iterator  i,
const_iterator  j 
)
inline

Constructs a String with a copy of the character sequence defined by the range [i,j).

Definition at line 8095 of file String.h.

◆ String() [11/37]

pcl::String::String ( std::initializer_list< char_type l)
inline

Constructs a String with a copy of the character sequence stored in the specified initializer list l.

This constructor is equivalent to:

String( l.begin(), l.end() )

Definition at line 8107 of file String.h.

◆ String() [12/37]

pcl::String::String ( const char16_t *  t)
inline

Constructs a String as a copy of a null-terminated string t of char16_t characters.

Definition at line 8115 of file String.h.

◆ String() [13/37]

pcl::String::String ( const char16_t *  t,
size_type  i,
size_type  n 
)
inline

Constructs a String with the n first characters of the null-terminated string t of char16_t characters, starting from its i-th character.

Definition at line 8124 of file String.h.

◆ String() [14/37]

pcl::String::String ( char16_t  c,
size_type  n 
)
inline

Constructs a String with n copies of a char16_t character c.

Definition at line 8131 of file String.h.

◆ String() [15/37]

pcl::String::String ( const wchar_t *  t)
inline

Constructs a String as a copy of a null-terminated string t of wchar_t characters.

Definition at line 8139 of file String.h.

◆ String() [16/37]

pcl::String::String ( const wchar_t *  t,
size_type  i,
size_type  n 
)
inline

Constructs a String with the n first characters of the null-terminated string t of wchar_t characters, starting from its i-th character.

Definition at line 8149 of file String.h.

◆ String() [17/37]

pcl::String::String ( wchar_t  c,
size_type  n 
)
inline

Constructs a String with n copies of a wchar_t character c.

Definition at line 8157 of file String.h.

◆ String() [18/37]

pcl::String::String ( const_c_string8  t)
inline

Constructs a String as a transformed copy of the null-terminated 8-bit, ISO/IEC-8859-1 string t.

Definition at line 8165 of file String.h.

◆ String() [19/37]

pcl::String::String ( const_c_string8  t,
size_type  i,
size_type  n 
)
inline

Constructs a String with the n first characters of the null-terminated, 8-bit ISO/IEC-8859-1 string t, starting from its i-th character.

Definition at line 8175 of file String.h.

◆ String() [20/37]

pcl::String::String ( const_char8_iterator  i,
const_char8_iterator  j 
)
inline

Constructs a String with the sequence of 8-bit characters in the range [i,j) of 8-bit string iterators.

Definition at line 8184 of file String.h.

◆ String() [21/37]

pcl::String::String ( std::initializer_list< char8_type l)
inline

Constructs a String with a copy of the 8-bit ISO/IEC-8859-1 character sequence stored in the specified initializer list l.

This constructor is equivalent to:

String( l.begin(), l.end() )

Definition at line 8197 of file String.h.

◆ String() [22/37]

pcl::String::String ( char8_type  c,
size_type  n = 1 
)
inline

Constructs a String object with n copies of an ISO/IEC-8859-1 character c.

Definition at line 8205 of file String.h.

◆ String() [23/37]

pcl::String::String ( bool  x)
inlineexplicit

Constructs a String as a literal representation of a bool value.

Definition at line 8213 of file String.h.

◆ String() [24/37]

pcl::String::String ( short  x)
inlineexplicit

Constructs a String as a literal representation of a signed short value.

Definition at line 8223 of file String.h.

◆ String() [25/37]

pcl::String::String ( unsigned short  x)
inlineexplicit

Constructs a String as a literal representation of an unsigned short value.

Definition at line 8233 of file String.h.

◆ String() [26/37]

pcl::String::String ( int  x)
inlineexplicit

Constructs a String as a literal representation of a signed int value.

Definition at line 8243 of file String.h.

◆ String() [27/37]

pcl::String::String ( unsigned int  x)
inlineexplicit

Constructs a String as a literal representation of an unsigned int value.

Definition at line 8253 of file String.h.

◆ String() [28/37]

pcl::String::String ( long  x)
inlineexplicit

Constructs a String as a literal representation of a signed long value.

Definition at line 8263 of file String.h.

◆ String() [29/37]

pcl::String::String ( unsigned long  x)
inlineexplicit

Constructs a String as a literal representation of an unsigned long value.

Definition at line 8273 of file String.h.

◆ String() [30/37]

pcl::String::String ( long long  x)
inlineexplicit

Constructs a String as a literal representation of a signed long long value.

Definition at line 8283 of file String.h.

◆ String() [31/37]

pcl::String::String ( unsigned long long  x)
inlineexplicit

Constructs a String as a literal representation of an unsigned long long value.

Definition at line 8293 of file String.h.

◆ String() [32/37]

pcl::String::String ( float  x)
inlineexplicit

Constructs a String as a literal representation of a float value.

Definition at line 8303 of file String.h.

◆ String() [33/37]

pcl::String::String ( double  x)
inlineexplicit

Constructs a String as a literal representation of a double value.

Definition at line 8313 of file String.h.

◆ String() [34/37]

pcl::String::String ( long double  x)
inlineexplicit

Constructs a String as a literal representation of a long double value.

Definition at line 8323 of file String.h.

◆ String() [35/37]

pcl::String::String ( Complex< float > &  x)
inlineexplicit

Constructs a String as a literal representation of an fcomplex value.

Definition at line 8338 of file String.h.

◆ String() [36/37]

pcl::String::String ( Complex< double > &  x)
inlineexplicit

Constructs a String as a literal representation of a dcomplex value.

Definition at line 8347 of file String.h.

◆ String() [37/37]

pcl::String::String ( Complex< long double > &  x)
inlineexplicit

Constructs a String as a literal representation of an lcomplex value.

Definition at line 8356 of file String.h.

Member Function Documentation

◆ AppendFormat() [1/2]

String& pcl::String::AppendFormat ( const_c_string8  fmt,
  ... 
)
inline

Appends a formatted representation of a variable-length set of values to the current contents of this string. Returns a reference to this string.

The fmt null-terminated string is a standard printf format string. It follows the same rules as its counterpart parameter in the standard printf( const char* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.

Definition at line 10887 of file String.h.

Referenced by pcl::BicubicFilterPixelInterpolation::Description(), pcl::Lanczos3LUTPixelInterpolation::Description(), pcl::Lanczos4LUTPixelInterpolation::Description(), and pcl::Lanczos5LUTPixelInterpolation::Description().

◆ AppendFormat() [2/2]

String& pcl::String::AppendFormat ( const wchar_t *  fmt,
  ... 
)
inline

Appends a formatted representation of a variable-length set of values to the current contents of this string. Returns a reference to this string.

The fmt null-terminated string is a standard printf format string of wchar_t characters. It follows the same rules as its counterpart parameter in the standard wprintf( const wchar_t* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.

Definition at line 10973 of file String.h.

◆ AppendVFormat() [1/2]

int pcl::String::AppendVFormat ( const_c_string8  fmt,
va_list  paramList 
)
inline

Appends a formatted representation of a variable-length set of values, specified as a va_list standard parameter list, to the current contents of this string. Returns the number of characters appended.

The fmt null-terminated string is a standard printf format string. It follows the same rules as its counterpart parameter in the standard printf( const char* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.

Definition at line 10930 of file String.h.

References pcl::IsoString::VFormat().

◆ AppendVFormat() [2/2]

int pcl::String::AppendVFormat ( const wchar_t *  fmt,
va_list  paramList 
)

Appends a formatted representation of a variable-length set of values, specified as a va_list standard parameter list, to the current contents of this string. Returns the number of characters appended.

The fmt null-terminated string is a standard printf format string of wchar_t characters. It follows the same rules as its counterpart parameter in the standard wprintf( const wchar_t* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.

◆ Assign() [1/19]

void pcl::String::Assign ( const String s)
inline

Assigns a string s to this string.

Definition at line 8549 of file String.h.

◆ Assign() [2/19]

void pcl::String::Assign ( const String s,
size_type  i,
size_type  n 
)
inline

Assigns a contiguous segment of n characters of a string s, starting from its i-th character, to this string.

Definition at line 8558 of file String.h.

◆ Assign() [3/19]

void pcl::String::Assign ( const_iterator  t)
inline

Assigns a null-terminated string t to this string.

Definition at line 8566 of file String.h.

◆ Assign() [4/19]

void pcl::String::Assign ( const_iterator  i,
const_iterator  j 
)
inline

Assigns a sequence of characters defined by the range [i,j) to this string.

Definition at line 8575 of file String.h.

◆ Assign() [5/19]

void pcl::String::Assign ( std::initializer_list< char_type l)
inline

Assigns a sequence of characters defined by the specified initializer list l to this string. This function is equivalent to:

Assign( l.begin(), l.end() )

Definition at line 8586 of file String.h.

◆ Assign() [6/19]

void pcl::String::Assign ( const_iterator  t,
size_type  i,
size_type  n 
)
inline

Assigns a contiguous segment of at most n characters of a null-terminated sequence t, starting from its i-th character, to this string.

Definition at line 8596 of file String.h.

◆ Assign() [7/19]

void pcl::String::Assign ( char_type  c,
size_type  n = 1 
)
inline

Assigns n copies of a character c to this string.

Definition at line 8604 of file String.h.

◆ Assign() [8/19]

void pcl::String::Assign ( const char16_t *  t)
inline

Assigns a null-terminated string t of char16_t to this string.

Definition at line 8612 of file String.h.

◆ Assign() [9/19]

void pcl::String::Assign ( const char16_t *  t,
size_type  i,
size_type  n 
)
inline

Assigns a contiguous segment of n characters of a null-terminated string t of char16_t, starting from its i-th character, to this string.

Definition at line 8622 of file String.h.

◆ Assign() [10/19]

void pcl::String::Assign ( char16_t  c,
size_type  n = 1 
)
inline

Assigns n copies of a char16_t character c to this string.

Definition at line 8630 of file String.h.

◆ Assign() [11/19]

void pcl::String::Assign ( const wchar_t *  t)

Assigns a null-terminated string t of wchar_t to this string.

◆ Assign() [12/19]

void pcl::String::Assign ( const wchar_t *  t,
size_type  i,
size_type  n 
)

Assigns a contiguous segment of n characters of a null-terminated string t of wchar_t, starting from its i-th character, to this string.

◆ Assign() [13/19]

void pcl::String::Assign ( wchar_t  c,
size_type  n = 1 
)
inline

Assigns n copies of a wchar_t character c to this string.

Definition at line 8650 of file String.h.

◆ Assign() [14/19]

void pcl::String::Assign ( const string8_base s)
inline

Assigns a copy of the 8-bit ISO/IEC-8859-1 string s to this string.

Definition at line 8658 of file String.h.

References pcl::GenericString< T, R, A >::Begin(), and pcl::GenericString< T, R, A >::Length().

◆ Assign() [15/19]

void pcl::String::Assign ( const_c_string8  t)
inline

Assigns a null-terminated 8-bit ISO/IEC-8859-1 string t to this object.

Definition at line 8676 of file String.h.

◆ Assign() [16/19]

void pcl::String::Assign ( const_c_string8  t,
size_type  i,
size_type  n 
)
inline

Assigns a contiguous segment of n characters of a null-terminated 8-bit ISO/IEC-8859-1 string t, starting from its i-th character, to this string.

Definition at line 8694 of file String.h.

References pcl::Min().

◆ Assign() [17/19]

void pcl::String::Assign ( const_char8_iterator  p,
const_char8_iterator  q 
)
inline

Assigns a contiguous sequence of 8-bit ISO/IEC-8859-1 characters in the range [i,j) to this string, replacing its previous contents.

Definition at line 8713 of file String.h.

◆ Assign() [18/19]

void pcl::String::Assign ( std::initializer_list< char8_type l)
inline

Assigns a sequence of 8-bit ISO/IEC-8859-1 characters defined by the specified initializer list l to this string. This function is equivalent to:

Assign( l.begin(), l.end() )

Definition at line 8732 of file String.h.

◆ Assign() [19/19]

void pcl::String::Assign ( char8_type  c,
size_type  n = 1 
)
inline

Assigns n copies of an ISO/IEC-8859-1 character c to this string.

Definition at line 8740 of file String.h.

◆ CurrentLocalISO8601DateTime()

static String pcl::String::CurrentLocalISO8601DateTime ( const ISO8601ConversionOptions options = ISO8601ConversionOptions())
static

Returns an ASCII representation of the current local date and time in ISO 8601 extended format.

Parameters
optionsOptional settings to control the representation of date and time in ISO 8601 format.
See also
CurrentUTCISO8601DateTime(), ToISO8601DateTime(), ISO8601ConversionOptions

◆ CurrentUTCISO8601DateTime()

static String pcl::String::CurrentUTCISO8601DateTime ( const ISO8601ConversionOptions options = ISO8601ConversionOptions())
static

Returns an ASCII representation of the current UTC date and time in ISO 8601 extended format.

Parameters
optionsOptional settings to control the representation of date and time in ISO 8601 format.
See also
CurrentLocalISO8601DateTime(), ToISO8601DateTime(), ISO8601ConversionOptions, TimePoint::Now()

◆ DecodedHTMLSpecialChars()

String pcl::String::DecodedHTMLSpecialChars ( ) const
inline

Returns a duplicate of this string with all occurrences of special HTML entities replaced with their corresponding plain text character equivalents.

See also
ToDecodedHTMLSpecialChars(), EncodedHTMLSpecialChars()

Definition at line 10828 of file String.h.

◆ EncodedHTMLSpecialChars()

String pcl::String::EncodedHTMLSpecialChars ( ) const
inline

Returns a duplicate of this string with all occurrences of HTML special characters replaced with valid HTML entities.

See also
ToEncodedHTMLSpecialChars(), DecodedHTMLSpecialChars()

Definition at line 10798 of file String.h.

◆ Format() [1/2]

String& pcl::String::Format ( const_c_string8  fmt,
  ... 
)
inline

Replaces the contents of this string with a formatted representation of a variable-length set of values. Returns a reference to this string.

The fmt null-terminated string is a standard printf format string. It follows the same rules as its counterpart parameter in the standard printf( const char* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.

Definition at line 10865 of file String.h.

◆ Format() [2/2]

String& pcl::String::Format ( const wchar_t *  fmt,
  ... 
)
inline

Replaces the contents of this string with a formatted representation of a variable-length set of values. Returns a reference to this string.

The fmt null-terminated string is a standard printf format string of wchar_t characters. It follows the same rules as its counterpart parameter in the standard wprintf( const wchar_t* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.

Definition at line 10950 of file String.h.

◆ operator=() [1/13]

String& pcl::String::operator= ( const String s)
inline

Copy assignment operator. Returns a reference to this object.

Definition at line 8394 of file String.h.

◆ operator=() [2/13]

String& pcl::String::operator= ( String &&  s)
inline

Move assignment operator. Returns a reference to this object.

Definition at line 8403 of file String.h.

◆ operator=() [3/13]

String& pcl::String::operator= ( const string_base s)
inline

Assigns a shallow copy of the string_base string s to this string. Returns a reference to this object.

Definition at line 8413 of file String.h.

◆ operator=() [4/13]

String& pcl::String::operator= ( string_base &&  s)
inline

Transfers the data from the string_base string s to this string (move assignment from base class). Returns a reference to this object.

Definition at line 8423 of file String.h.

◆ operator=() [5/13]

String& pcl::String::operator= ( const string8_base s)
inline

Assigns a copy of the 8-bit ISO/IEC-8859-1 string s to this string. Returns a reference to this object.

Definition at line 8433 of file String.h.

◆ operator=() [6/13]

String& pcl::String::operator= ( const_iterator  t)
inline

Assigns a copy of the null-terminated string t to this string. Returns a reference to this object.

Definition at line 8443 of file String.h.

◆ operator=() [7/13]

String& pcl::String::operator= ( char_type  c)
inline

Assigns a single copy of a character c to this string. Returns a reference to this object.

Definition at line 8453 of file String.h.

◆ operator=() [8/13]

String& pcl::String::operator= ( const char16_t *  t)
inline

Assigns a copy of the null-terminated string t of char16_t to this string. Returns a reference to this object.

Definition at line 8463 of file String.h.

◆ operator=() [9/13]

String& pcl::String::operator= ( char16_t  c)
inline

Assigns a single copy of a char16_t character c to this string. Returns a reference to this object.

Definition at line 8473 of file String.h.

◆ operator=() [10/13]

String& pcl::String::operator= ( const wchar_t *  t)
inline

Assigns a copy of the null-terminated string t of wchar_t to this string. Returns a reference to this object.

Definition at line 8483 of file String.h.

◆ operator=() [11/13]

String& pcl::String::operator= ( wchar_t  c)
inline

Assigns a single copy of a wchar_t character c to this string. Returns a reference to this object.

Definition at line 8493 of file String.h.

◆ operator=() [12/13]

String& pcl::String::operator= ( const_c_string8  t)
inline

Assigns a copy of the null-terminated 8-bit ISO/IEC-8859-1 string t to this string. Returns a reference to this object.

Definition at line 8503 of file String.h.

◆ operator=() [13/13]

String& pcl::String::operator= ( char8_type  c)
inline

Assigns a single copy of an ISO/IEC-8859-1 character c to this string. Returns a reference to this object.

Definition at line 8513 of file String.h.

◆ ParseISO8601DateTime()

void pcl::String::ParseISO8601DateTime ( int &  year,
int &  month,
int &  day,
double &  dayf,
double &  tz 
) const

Evaluates this string as a date and time specification in ISO 8601 extended format, and stores the resulting components in the specified variables.

Parameters
yearOn output, the year of the date.
monthOn output, the month of the date in the range [1,12].
dayOn output, the day of the date in the range [1,31].
dayfOn output, the day fraction corresponding to the time specification, in the range [0,1).
tzOn output, the time zone offset in hours, in the range [-12,+12].

In ISO 8601 extended representations, decimal fractions must be divided from integer parts exclusively by the full stop or dot character ('.', ASCII code point 46(10) = 2E(16)).

See also
TryParseISO8601DateTime(), TimePoint::FromString()

Referenced by pcl::TimePoint::FromString(), and pcl::TimePoint::TimePoint().

◆ Random()

static String pcl::String::Random ( size_type  n,
RandomizationOptions  options = RandomizationOption::Default 
)
static

Generates a string of n random 16-bit code points, with character types and ranges as prescribed by the specified options.

See also
RandomizationOption

◆ To7BitASCII()

IsoString pcl::String::To7BitASCII ( ) const

Returns a 7-bit ASCII string with a converted copy of this String object. Characters in this string that cannot be converted to the 7-bit ASCII set (that is, characters with code points greater than 0x80) will have undefined values in the returned string. Undefined values are represented with question mark characters (?).

See also
ToIsoString(), ToUTF8(), ToMBS(), ToUTF32()

◆ ToBool()

bool pcl::String::ToBool ( ) const

Evaluates this string as a Boolean literal, and returns the result as a bool value.

Returns true if this string is equal to "1", "true", "TRUE" or "T". Returns false if this string is equal to "0", "false", "FALSE" or "F". Otherwise this function throws a ParseError exception.

See also
TryToBool()

◆ ToColonSeparated()

template<class C >
String& pcl::String::ToColonSeparated ( const C &  c)
inline

Replaces the contents of this string with a sequence of colon-separated tokens extracted from a container c. Returns a reference to this string.

This member function is equivalent to:

ToSeparated( c, char16_type( ':' ) );

Definition at line 10695 of file String.h.

◆ ToCommaSeparated()

template<class C >
String& pcl::String::ToCommaSeparated ( const C &  c)
inline

Replaces the contents of this string with a sequence of comma-separated tokens extracted from a container c. Returns a reference to this string.

This member function is equivalent to:

ToSeparated( c, char16_type( ',' ) );

Definition at line 10680 of file String.h.

◆ ToDecodedHTMLSpecialChars()

String& pcl::String::ToDecodedHTMLSpecialChars ( )

Replaces all occurrences of special HTML entities in this string with their corresponding plain text character equivalents. Returns a reference to this string.

The following replacements are performed:

"\&amp;" (ampersand) becomes '&'
"\&quot;" (double quote) becomes '"'
"\&#039;" (single quote) becomes "'"
"\&apos;" (apostrophe) becomes "'"
"\&lt;" (less than) becomes '<'
"\&gt;" (greater than) becomes '>'

See also
DecodedHTMLSpecialChars(), ToEncodedHTMLSpecialChars()

◆ ToDouble()

double pcl::String::ToDouble ( ) const

Evaluates this string as a floating point literal, and returns the result as a double value.

The source string is expected to have the following format (informal format specification):

[+|-][<integer-part>][.[<decimal-part>]][<exp>[+|-]<exponent>]

where <integer-part> and <decimal-part> are optional sequences of decimal digits from 0 to 9, <exp> is an exponent specifier (the letter 'e' (or 'E')), and <exponent> is a sequence of decimal digits specifying a power of ten that multiplies the preceding numeric constant. At least a one-digit integer part, or a one-digit decimal part, is mandatory. FORTRAN exponent specifiers ('d' and 'f' (or 'D' and 'F')) are also recognized by this implementation.

If this string doesn't contain a valid floating point literal, or if the range of double is exceeded, this member function throws a ParseError exception.

See also
TryToDouble()

◆ ToEncodedHTMLSpecialChars()

String& pcl::String::ToEncodedHTMLSpecialChars ( )

Replaces all occurrences of HTML special characters in this string with valid HTML entities. Returns a reference to this string.

The following replacements are performed:

'&' (ampersand) becomes "\&amp;"
'"' (double quote) becomes "\&quot;"
"'" (single quote) becomes "\&#039;"
'<' (less than) becomes "\&lt;"
'>' (greater than) becomes "\&gt;"

See also
EncodedHTMLSpecialChars(), ToDecodedHTMLSpecialChars()

◆ ToFloat()

float pcl::String::ToFloat ( ) const

Evaluates this string as a floating point numeric literal, and returns the result as a float value.

For information about the legal syntax of a floating point literal, see the documentation for the ToDouble() member function.

If this string doesn't contain a valid floating point literal, or if the range of float is exceeded, this member function throws a ParseError exception.

See also
TryToFloat()

◆ ToHyphenated()

template<class C >
String& pcl::String::ToHyphenated ( const C &  c)
inline

Replaces the contents of this string with a hyphenated sequence of tokens extracted from a container c. Returns a reference to this string.

This member function is equivalent to:

ToSeparated( c, char16_type( '-' ) );

Definition at line 10769 of file String.h.

◆ ToInt() [1/2]

long pcl::String::ToInt ( ) const
inline

Evaluates this string as an integer literal, and returns the result as a long value.

Calling this member function for a string s is equivalent to:

long n = s.ToInt( 0 );

See the documentation under ToInt( int ) for information about automatic base conversions when base=0 is specified.

If this string doesn't contain a valid integer literal, or if the range of long is exceeded, this member function throws a ParseError exception.

See also
TryToInt()

Definition at line 11321 of file String.h.

◆ ToInt() [2/2]

long pcl::String::ToInt ( int  base) const

Evaluates this string as an integer literal in the specified base, and returns the result as a long value.

If base is 0, the source string is expected to represent either a decimal constant, an octal constant, or a hexadecimal constant, any of which optionally preceded by a sign character (+ or -). A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits from '0' to '9'. An octal begins with the prefix '0', optionally followed by a sequence of the digits 0 to 7 only. A hexadecimal constant begins with the prefix '0x' or '0X', which must be followed by a sequence of decimal digits and letters from 'a' (or 'A') to 'f' (or 'F'), whose corresponding decimal values are from 10 to 15, respectively.

Other legal values of base, from 2 to 36, specify the expected base of the integer constant represented by the source string. Decimal digits and letters from 'a' (or 'A') to 'z' (or 'Z') are used to represent all possible digits in the specified base, as necessary.

If this string doesn't contain a valid integer literal in the specified base, if an illegal base is specified, or if the range of long is exceeded, this member function throws a ParseError exception.

See also
TryToInt( int&, int ) const

◆ ToInt64() [1/2]

long long pcl::String::ToInt64 ( ) const
inline

Evaluates this string as an integer literal, and returns the result as a long long value.

Calling this member function for a string s is equivalent to:

long long n = s.ToInt64( 0 );

If this string doesn't contain a valid integer literal, or if the range of long long is exceeded, this member function throws a ParseError exception.

See also
TryToInt64()

Definition at line 11502 of file String.h.

◆ ToInt64() [2/2]

long long pcl::String::ToInt64 ( int  base) const

Evaluates this string as an unsigned integer literal in the specified base, and returns the result as a long long value.

For information about possible values of base and how these are interpreted, see the documentation under ToInt( int ).

If this string doesn't contain a valid integer literal in the specified base, if an illegal base is specified, or if the range of long long is exceeded, this member function throws a ParseError exception.

See also
TryToInt64( long long&, int ) const

◆ ToISO8601DateTime()

static String pcl::String::ToISO8601DateTime ( int  year,
int  month,
int  day,
double  dayf,
double  tz = 0,
const ISO8601ConversionOptions options = ISO8601ConversionOptions() 
)
static

Returns a string representation of a date and time in ISO 8601 extended format.

Parameters
yearThe year of the date.
monthThe month of the date in the range [1,12].
dayThe day of the date in the range [1,31].
dayfThe day fraction corresponding to the time specification, in the range [0,1).
tzThe time zone offset in hours, in the range [-12,+12]. The default value is zero, to be interpreted as UTC.
optionsOptional settings to control the representation of date and time in ISO 8601 format.
See also
CurrentUTCISO8601DateTime(), CurrentLocalISO8601DateTime(), ParseISO8601DateTime(), ISO8601ConversionOptions, TimePoint::ToString()

◆ ToIsoString()

IsoString pcl::String::ToIsoString ( ) const

Returns an 8-bit, ISO/IEC-8859-1 string with a converted copy of this String object. Characters in this string that cannot be converted to ISO-8859-1 (that is, characters with code points greater than 0x100) will have undefined values in the returned string. Undefined values are represented with question mark characters (?).

See also
ToUTF8(), ToMBS(), ToUTF32(), To7BitASCII()

◆ ToLocal8Bit()

IsoString pcl::String::ToLocal8Bit ( ) const
inline

Returns a copy of this Unicode string converted to an 8-bit locale-dependent string. On UNIX/Linux systems (FreeBSD, Linux, Mac OS X) this function is equivalent to ToUTF8(). On Windows, this function returns ToMBS().

See also
ToUTF8(), ToMBS();

Definition at line 11121 of file String.h.

◆ ToMBS()

IsoString pcl::String::ToMBS ( ) const

Returns a copy of this Unicode string converted to a multibyte string. This conversion is dependent on the current locale.

In the event of conversion error (if there are invalid wide characters in the source string) this routine returns an empty string.

This member function is a convenience wrapper for the wcstombs() routine of the standard C runtime library. Note that on platforms where the size of wchar_t is four bytes (e.g. Linux) this routine performs an additional conversion from UTF-16 to UTF-32. On platforms where the size of wchar_t is two bytes (e.g. Windows), the conversion is direct.

See also
ToUTF8(), ToLocal8Bit(), ToIsoString(), ToUTF32();

◆ ToNewLineSeparated()

template<class C >
String& pcl::String::ToNewLineSeparated ( const C &  c)
inline

Replaces the contents of this string with a sequence of new line separated tokens extracted from a container c. Returns a reference to this string.

This member function is equivalent to:

ToSeparated( c, char16_type( '\n' ) );

Definition at line 10740 of file String.h.

◆ ToNullSeparated()

template<class C >
String& pcl::String::ToNullSeparated ( const C &  c)
inline

Replaces the contents of this string with a sequence of null-separated tokens extracted from a container c. Returns a reference to this string.

This member function is equivalent to:

ToSeparated( c, char16_type( '\0' ) );

Definition at line 10755 of file String.h.

◆ ToSeparated() [1/8]

template<class C >
String& pcl::String::ToSeparated ( const C &  c,
char_type  separator 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator character. Returns a reference to this string.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10527 of file String.h.

◆ ToSeparated() [2/8]

template<class C , class AF >
String& pcl::String::ToSeparated ( const C &  c,
char_type  separator,
AF  append 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator character, and built using an append binary function. Returns a reference to this string.

The binary function must be of the form:

void append( String& s, char16_type c );

where c is being appended to s.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10550 of file String.h.

◆ ToSeparated() [3/8]

template<class C >
String& pcl::String::ToSeparated ( const C &  c,
const String separator 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator string. Returns a reference to this string.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10566 of file String.h.

◆ ToSeparated() [4/8]

template<class C , class AF >
String& pcl::String::ToSeparated ( const C &  c,
const String separator,
AF  append 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator string, and built using an append binary function. Returns a reference to this string.

The binary function must be of the form:

void append( String& s1, const String& s2 );

where s2 is being appended to s1.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10589 of file String.h.

◆ ToSeparated() [5/8]

template<class C >
String& pcl::String::ToSeparated ( const C &  c,
const_c_string  separator 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator null-terminated string. Returns a reference to this string.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10605 of file String.h.

◆ ToSeparated() [6/8]

template<class C , class AF >
String& pcl::String::ToSeparated ( const C &  c,
const_c_string  separator,
AF  append 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator null-terminated string, and built using an append binary function. Returns a reference to this string.

The binary function must be of the form:

void append( String& s1, const char16_type* s2 );

where s2 is being appended to s1.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10627 of file String.h.

◆ ToSeparated() [7/8]

template<class C >
String& pcl::String::ToSeparated ( const C &  c,
const_c_string8  separator 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator null-terminated 8-bit string (const char*). Returns a reference to this string.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10643 of file String.h.

◆ ToSeparated() [8/8]

template<class C , class AF >
String& pcl::String::ToSeparated ( const C &  c,
const_c_string8  separator,
AF  append 
)
inline

Replaces the contents of this string with a sequence of tokens extracted from a container c, separated with the specified separator null-terminated 8-bit string (const char*), and built using an append binary function. Returns a reference to this string.

The binary function must be of the form:

void append( String& s1, const char* s2 );

where s2 is being appended to s1.

The container type C must have separated list generation semantics. All iterable PCL containers such as Array, Vector, etc. provide the necessary ToSeparated member functions.

Definition at line 10665 of file String.h.

◆ ToSpaceSeparated()

template<class C >
String& pcl::String::ToSpaceSeparated ( const C &  c)
inline

Replaces the contents of this string with a sequence of space-separated tokens extracted from a container c. Returns a reference to this string.

This member function is equivalent to:

ToSeparated( c, char16_type( ' ' ) );

Definition at line 10710 of file String.h.

◆ ToTabSeparated()

template<class C >
String& pcl::String::ToTabSeparated ( const C &  c)
inline

Replaces the contents of this string with a sequence of tabulator-separated tokens extracted from a container c. Returns a reference to this string.

This member function is equivalent to:

ToSeparated( c, char16_type( '\t' ) );

Definition at line 10725 of file String.h.

◆ ToUInt() [1/2]

unsigned long pcl::String::ToUInt ( ) const
inline

Evaluates this string as an unsigned integer literal, and returns the result as an unsigned long value.

Calling this member function for a string s is equivalent to:

unsigned long n = s.ToUInt( 0 );

See the documentation under ToInt( int ) for information about automatic base conversions when base=0 is specified.

If this string doesn't contain a valid unsigned integer literal, or if the range of unsigned long is exceeded, this member function throws a ParseError exception.

See also
TryToUInt()

Definition at line 11418 of file String.h.

◆ ToUInt() [2/2]

unsigned long pcl::String::ToUInt ( int  base) const

Evaluates this string as an unsigned integer literal in the specified base, and returns the result as an unsigned long value.

For information about possible values of base and how these are interpreted, see the documentation under ToInt( int ). The only exception is that for this member function, only a + sign is legal preceding the numeric constant represented by the source string.

If this string doesn't contain a valid integer literal in the specified base, if an illegal base is specified, or if the range of unsigned long is exceeded, this member function throws a ParseError exception.

See also
TryToUInt( unsigned&, int ) const

◆ ToUInt64() [1/2]

unsigned long long pcl::String::ToUInt64 ( ) const
inline

Evaluates this string as an unsigned integer literal in the specified base, and returns the result as an unsigned long long value.

Calling this member function for a string s is equivalent to:

unsigned long long n = s.ToUInt64( 0 );

If this string doesn't contain a valid unsigned integer literal, or if the range of unsigned long long is exceeded, this member function throws a ParseError exception.

See also
TryToUInt64()

Definition at line 11585 of file String.h.

◆ ToUInt64() [2/2]

unsigned long long pcl::String::ToUInt64 ( int  base) const

Evaluates this string as an unsigned integer literal in the specified base, and returns the result as an unsigned long long value.

For information about possible values of base and how these are interpreted, see the documentation under ToInt( int ).

If this string doesn't contain a valid unsigned integer literal in the specified base, if an illegal base is specified, or if the range of unsigned long long is exceeded, this member function throws a ParseError exception.

See also
TryToUInt64( unsigned long long&, int ) const

◆ ToUTF32()

Array<uint32> pcl::String::ToUTF32 ( size_type  i = 0,
size_type  n = maxPos 
) const
inline

Returns a dynamic array of 32-bit integers with a UTF-32 representation of a subset of n contiguous UTF-16 characters from this String object, starting at the i-th character. A null terminating character (uint32( 0 ) specifically) is always appended to the resulting array.

See also
ToWCharArray(), ToUTF8(), ToMBS(), ToIsoString()

Definition at line 11181 of file String.h.

◆ ToUTF8()

IsoString pcl::String::ToUTF8 ( size_type  i = 0,
size_type  n = maxPos 
) const
inline

Returns an 8-bit string with a UTF-8 representation of a subset of n contiguous UTF-16 characters from this String object, starting at the i-th character.

See also
ToMBS(), ToLocal8Bit(), ToIsoString(), ToUTF32()

Definition at line 11091 of file String.h.

Referenced by pcl::operator>=().

◆ ToWCharArray()

Array<wchar_t> pcl::String::ToWCharArray ( size_type  i = 0,
size_type  n = maxPos 
) const
inline

Returns a copy of a contiguous segment of n characters of this string, starting from its i-th character, as a dynamic array of wchar_t. A null terminating character (L'\0' specifically) is always appended to the resulting array.

Depending on the platform, the wchar_t type may be 16-bit wide (Windows) or 32-bit wide (UNIX/Linux). The char16_type used by String is always a 16-bit character (UTF-16) on all supported platforms.

This member function provides a platform-independent way to obtain the contents of a String object as a standard null-terminated string of wchar_t characters.

On platforms where wchar_t occupies four bytes (UNIX/Linux), this function assumes that this String object contains no surrogates. For a generalized conversion from UTF-16 to UTF-32, see ToUTF32().

See also
ToUTF32(), ToUTF8(), ToMBS(), ToIsoString()

Definition at line 11150 of file String.h.

References pcl::Min().

Referenced by pcl::operator>=().

◆ TryParseISO8601DateTime()

bool pcl::String::TryParseISO8601DateTime ( int &  year,
int &  month,
int &  day,
double &  dayf,
double &  tz 
) const

Attempts to evaluate this string as a date and time specification in ISO 8601 extended format. If successful, stores the resulting components in the specified year, month, day and dayf and tz variables, and returns true. For more information on syntax and output values and ranges, see the ParseISO8601DateTime().

If this string cannot be evaluated as a valid date and time in ISO 8601 format, this function returns false and does not change any of the passed variables. This function does not throw any exception.

See also
ParseISO8601DateTime(), TimePoint::TryFromString()

Referenced by pcl::TimePoint::TryFromString().

◆ TryToBool()

bool pcl::String::TryToBool ( bool &  value) const

Attempts to evaluate this string as a Boolean literal.

If this string can legally be converted to a Boolean value, this function returns true and stores the evaluation result in the value variable. A string can only be converted to Boolean type if it is equal to either "1", "true", "TRUE", "T", "0", "false", "FALSE" or "F".

If this string cannot be converted to a Boolean value, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToBool()

◆ TryToDouble()

bool pcl::String::TryToDouble ( double &  value) const

Attempts to evaluate this string as a floating point numeric literal.

If this string can legally be converted to a floating point number, this function returns true and stores the evaluation result in the value variable. For information about the legal syntax of a floating point literal, see the documentation for the ToDouble() member function.

If this string cannot be converted to a floating point number, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToDouble()

◆ TryToFloat()

bool pcl::String::TryToFloat ( float &  value) const

Attempts to evaluate this string as a floating point numeric literal.

If this string can legally be converted to a floating point number, this function returns true and stores the evaluation result in the value variable. For information about the legal syntax of a floating point literal, see the documentation for the ToDouble() member function.

If this string cannot be converted to a floating point number, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToFloat()

◆ TryToInt() [1/2]

bool pcl::String::TryToInt ( int &  value) const
inline

Attempts to evaluate this string as an integer numeric literal.

If this string can legally be converted to an integer number, this function returns true and stores the evaluation result in the value variable.

Calling this member function for a string s is equivalent to:

int v;
if ( s.TryToInt( v, 0 ) ) ...

See the documentation under ToInt( int ) for information about automatic base conversions when base=0 is specified.

If this string cannot be converted to an integer number, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToInt()

Definition at line 11349 of file String.h.

◆ TryToInt() [2/2]

bool pcl::String::TryToInt ( int &  value,
int  base 
) const

Attempts to evaluate this string as an integer numeric literal in the specified base.

If this string can legally be converted to an integer number in the specified base, this function returns true and stores the evaluation result in the value variable.

See the documentation under ToInt( int ) for information about automatic base conversions when base=0 is specified.

If this string cannot be converted to an integer number in the specified base, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToInt( int ) const

◆ TryToInt64() [1/2]

bool pcl::String::TryToInt64 ( long long &  value) const
inline

Attempts to evaluate this string as a 64-bit integer numeric literal in the specified base.

If this string can legally be converted to a 64-bit integer number in the specified base, this function returns true and stores the evaluation result in the value variable.

Calling this member function for a string s is equivalent to:

long long v;
if ( s.TryToInt64( v, 0 ) ) ...

See the documentation under ToInt( int ) for information about automatic base conversions when base=0 is specified.

If this string cannot be converted to a 64-bit integer number, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToInt64()

Definition at line 11531 of file String.h.

◆ TryToInt64() [2/2]

bool pcl::String::TryToInt64 ( long long &  value,
int  base 
) const

Attempts to evaluate this string as a 64-bit integer numeric literal in the specified base.

If this string can legally be converted to a 64-bit integer number in the specified base, this function returns true and stores the evaluation result in the value variable.

For information about possible values of base and how these are interpreted, see the documentation under ToInt( int ).

If this string cannot be converted to a 64-bit integer number in the specified base, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToInt64( int ) const

◆ TryToUInt() [1/2]

bool pcl::String::TryToUInt ( unsigned &  value) const
inline

Attempts to evaluate this string as an unsigned integer literal.

If this string can legally be converted to an unsigned integer number, this function returns true and stores the evaluation result in the value variable.

Calling this member function for a string s is equivalent to:

unsigned v;
if ( s.TryToUInt( v, 0 ) ) ...

See the documentation under ToInt( int ) for information about automatic base conversions when base=0 is specified.

If this string cannot be converted to an integer number, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToUInt()

Definition at line 11446 of file String.h.

◆ TryToUInt() [2/2]

bool pcl::String::TryToUInt ( unsigned &  value,
int  base 
) const

Attempts to evaluate this string as an unsigned integer literal in the specified base.

If this string can legally be converted to an unsigned integer number in the specified base, this function returns true and stores the evaluation result in the value variable.

See the documentation under ToUInt( int ) for information about automatic base conversions when base=0 is specified.

If this string cannot be converted to an unsigned integer number in the specified base, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToUInt( int ) const

◆ TryToUInt64() [1/2]

bool pcl::String::TryToUInt64 ( unsigned long long &  value) const
inline

Attempts to evaluate this string as a 64-bit unsigned integer numeric literal in the specified base.

If this string can legally be converted to a 64-bit unsigned integer number in the specified base, this function returns true and stores the evaluation result in the value variable.

Calling this member function for a string s is equivalent to:

unsigned long long v;
if ( s.TryToUInt64( v, 0 ) ) ...

See the documentation under ToInt( int ) for information about automatic base conversions when base=0 is specified.

If this string cannot be converted to a 64-bit unsigned integer number, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToUInt64()

Definition at line 11614 of file String.h.

◆ TryToUInt64() [2/2]

bool pcl::String::TryToUInt64 ( unsigned long long &  value,
int  base 
) const

Attempts to evaluate this string as an unsigned 64-bit integer numeric literal in the specified base.

If this string can legally be converted to an unsigned 64-bit integer number in the specified base, this function returns true and stores the evaluation result in the value variable.

For information about possible values of base and how these are interpreted, see the documentation under ToInt( int ).

If this string cannot be converted to an unsigned 64-bit integer number in the specified base, this function returns false and does not change the value variable. This function does not throw any exception.

See also
ToUInt64( int ) const

◆ UTF16ToUTF32()

static Array<uint32> pcl::String::UTF16ToUTF32 ( const_c_string  string,
size_type  i = 0,
size_type  n = maxPos 
)
static

Conversion of a UTF-16 substring to a UTF-32 string.

Converts a contiguous sequence of n characters starting at the i-th position of the specified null-terminated UTF-16 string. Returns the resulting UTF-32 string as a dynamic array.

See also
UTF8ToUTF16(), UTF16ToUTF8(), UTF32ToUTF16()

◆ UTF16ToUTF8()

static IsoString pcl::String::UTF16ToUTF8 ( const_c_string  string,
size_type  i = 0,
size_type  n = maxPos 
)
static

Conversion of a UTF-16 substring to a UTF-8 string.

Converts a contiguous sequence of n characters starting at the i-th position of the specified null-terminated UTF-16 string. Returns the resulting UTF-8 string.

See also
UTF8ToUTF16(), UTF16ToUTF32(), UTF32ToUTF16()

◆ UTF32ToUTF16()

static String pcl::String::UTF32ToUTF16 ( const uint32 string,
size_type  i = 0,
size_type  n = maxPos 
)
static

Conversion of a UTF-32 substring to a UTF-16 string.

Converts a contiguous sequence of n characters starting at the i-th position of the specified null-terminated UTF-32 string. Returns the resulting UTF-16 string.

See also
UTF8ToUTF16(), UTF16ToUTF8(), UTF16ToUTF32()

◆ UTF8ToUTF16()

static String pcl::String::UTF8ToUTF16 ( const_c_string8  string,
size_type  i = 0,
size_type  n = maxPos 
)
static

Conversion of a UTF-8 substring to a UTF-16 string.

Converts a contiguous sequence of n characters starting at the i-th position of the specified null-terminated UTF-8 string. Returns the resulting UTF-16 string.

See also
UTF16ToUTF8(), UTF16ToUTF32(), UTF32ToUTF16()

Referenced by pcl::IsoString::UTF8ToUTF16().

◆ UUID()

static String pcl::String::UUID ( )
static

Generates a universally unique identifier (UUID) in canonical form.

The canonical UUID has 36 characters with the following format:

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

where 'x' represents a lowercase hexadecimal digit, '4' is the UUID version indicator (version 4 = truly random UUID), and 'y' is one of '8', '9', 'a', or 'b'.

◆ VFormat() [1/2]

int pcl::String::VFormat ( const_c_string8  fmt,
va_list  paramList 
)
inline

Replaces the contents of this string with a formatted representation of a variable-length set of values, specified as a va_list standard parameter list. Returns the number of characters generated.

The fmt null-terminated string is a standard printf format string. It follows the same rules as its counterpart parameter in the standard printf( const char* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.

Definition at line 10910 of file String.h.

References pcl::IsoString::VFormat().

◆ VFormat() [2/2]

int pcl::String::VFormat ( const wchar_t *  fmt,
va_list  paramList 
)

Replaces the contents of this string with a formatted representation of a variable-length set of values, specified as a va_list standard parameter list. Returns the number of characters generated.

The fmt null-terminated string is a standard printf format string of wchar_t characters. It follows the same rules as its counterpart parameter in the standard wprintf( const wchar_t* fmt, ... ) C runtime function.

The required space to store the resulting formatted output is calculated and allocated transparently.


The documentation for this class was generated from the following file: