PCL
pcl::GenericString< T, R, A > Class Template Reference

Generic character string. More...

#include <String.h>

+ Inheritance diagram for pcl::GenericString< T, R, A >:

Public Types

using allocator = pcl::Allocator< T, A >
 
using block_allocator = A
 
using c_string = T *
 
using char_traits = R
 
using char_type = T
 
using const_c_string = const T *
 
using const_iterator = const T *
 
using const_reverse_iterator = ReverseRandomAccessIterator< const_iterator, const T >
 
using iterator = T *
 
using reverse_iterator = ReverseRandomAccessIterator< iterator, T >
 

Public Member Functions

 GenericString ()
 
 GenericString (char_type c, size_type n=1)
 
 GenericString (const GenericString &s)
 
 GenericString (const_c_string t)
 
 GenericString (const_c_string t, size_type i, size_type n)
 
 GenericString (const_iterator i, const_iterator j)
 
 GenericString (GenericString &&s)
 
 GenericString (std::initializer_list< char_type > l)
 
 ~GenericString ()
 
void Add (char_type c, size_type n=1)
 
template<class R1 , class A1 >
void Add (const GenericString< T, R1, A1 > &s)
 
void Add (const_c_string t)
 
void Add (const_c_string t, size_type n)
 
void Add (const_iterator i, const_iterator j)
 
const allocatorAllocator () const noexcept
 
void Append (char_type c, size_type n=1)
 
template<class R1 , class A1 >
void Append (const GenericString< T, R1, A1 > &s)
 
void Append (const_c_string t)
 
void Append (const_c_string t, size_type n)
 
void Append (const_iterator i, const_iterator j)
 
void Assign (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_c_string t, size_type i, size_type n)
 
void Assign (const_iterator i, const_iterator j)
 
void Assign (std::initializer_list< char_type > l)
 
iterator At (size_type i)
 
const_iterator At (size_type i) const noexcept
 
size_type Available () const noexcept
 
iterator Begin ()
 
iterator begin ()
 
const_iterator Begin () const noexcept
 
const_iterator begin () const noexcept
 
template<class C >
size_type Break (C &list, char_type c, bool trim=false, size_type i=0) const
 
template<class C , typename S >
size_type Break (C &list, const Array< S > &ca, bool trim=false, size_type i=0) const
 
template<class C , class R1 , class A1 >
size_type Break (C &list, const GenericString< T, R1, A1 > &s, bool trim=false, size_type i=0) const
 
template<class C >
size_type Break (C &list, const_c_string s, bool trim=false, size_type i=0) const
 
template<class C >
size_type BreakIC (C &list, char_type c, bool trim=false, size_type i=0) const
 
template<class C , class R1 , class A1 >
size_type BreakIC (C &list, const GenericString< T, R1, A1 > &s, bool trim=false, size_type i=0) const
 
template<class C >
size_type BreakIC (C &list, const_c_string s, bool trim=false, size_type i=0) const
 
void c_copy (iterator dst, size_type maxCharsToCopy, size_type i=0) const noexcept
 
const_c_string c_str () const noexcept
 
size_type Capacity () const noexcept
 
GenericString CaseFolded () const
 
GenericString CenterJustified (size_type width, char_type fill=R::Blank()) const
 
void Clear ()
 
int Compare (char_type c, bool caseSensitive=true, bool localeAware=true) const noexcept
 
template<class R1 , class A1 >
int Compare (const GenericString< T, R1, A1 > &s, bool caseSensitive=true, bool localeAware=true) const noexcept
 
int Compare (const_c_string t, bool caseSensitive=true, bool localeAware=true) const noexcept
 
int CompareCodePoints (char_type c, bool caseSensitive=true) const noexcept
 
template<class R1 , class A1 >
int CompareCodePoints (const GenericString< T, R1, A1 > &s, bool caseSensitive=true) const noexcept
 
int CompareCodePoints (const_c_string t, bool caseSensitive=true) const noexcept
 
int CompareIC (char_type c, bool localeAware=true) const noexcept
 
template<class R1 , class A1 >
int CompareIC (const GenericString< T, R1, A1 > &s, bool localeAware=true) const noexcept
 
int CompareIC (const_c_string t, bool localeAware=true) const noexcept
 
bool Contains (char_type c) const noexcept
 
template<class R1 , class A1 >
bool Contains (const GenericString< T, R1, A1 > &s) const noexcept
 
bool Contains (const_c_string t) const noexcept
 
bool ContainsIC (char_type c) const noexcept
 
template<class R1 , class A1 >
bool ContainsIC (const GenericString< T, R1, A1 > &s) const noexcept
 
bool ContainsIC (const_c_string t) const noexcept
 
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)
 
template<class R1 , class A1 >
void DeleteString (const GenericString< T, R1, A1 > &s, size_type i=0)
 
void DeleteString (const_c_string t, size_type i=0)
 
template<class R1 , class A1 >
void DeleteStringIC (const GenericString< T, 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 ()
 
iterator end ()
 
const_iterator End () const noexcept
 
const_iterator end () const noexcept
 
bool EndsWith (char_type c) const noexcept
 
template<class R1 , class A1 >
bool EndsWith (const GenericString< T, R1, A1 > &s) const noexcept
 
bool EndsWith (const_c_string t) const noexcept
 
bool EndsWithIC (char_type c) const noexcept
 
template<class R1 , class A1 >
bool EndsWithIC (const GenericString< T, R1, A1 > &s) const noexcept
 
bool EndsWithIC (const_c_string t) const noexcept
 
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 (char_type c, size_type i=0) const noexcept
 
template<class R1 , class A1 >
size_type Find (const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
 
size_type Find (const_c_string t, size_type i=0) const noexcept
 
size_type FindFirst (char_type c, size_type i=0) const noexcept
 
template<class R1 , class A1 >
size_type FindFirst (const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
 
size_type FindFirst (const_c_string t, size_type i=0) const noexcept
 
size_type FindFirstIC (char_type c, size_type i=0) const noexcept
 
template<class R1 , class A1 >
size_type FindFirstIC (const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
 
size_type FindFirstIC (const_c_string t, size_type i=0) const noexcept
 
size_type FindIC (char_type c, size_type i=0) const noexcept
 
template<class R1 , class A1 >
size_type FindIC (const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
 
size_type FindIC (const_c_string t, size_type i=0) const noexcept
 
size_type FindLast (char_type c, size_type r=maxPos) const noexcept
 
template<class R1 , class A1 >
size_type FindLast (const GenericString< T, R1, A1 > &s, size_type r=maxPos) const noexcept
 
size_type FindLast (const_c_string t, size_type r=maxPos) const noexcept
 
size_type FindLastIC (char_type c, size_type r=maxPos) const noexcept
 
template<class R1 , class A1 >
size_type FindLastIC (const GenericString< T, R1, A1 > &s, size_type r=maxPos) const noexcept
 
size_type FindLastIC (const_c_string t, size_type r=maxPos) const noexcept
 
char_type FirstChar () const noexcept
 
uint64 Hash (uint64 seed=0) const noexcept
 
uint32 Hash32 (uint32 seed=0) const noexcept
 
uint64 Hash64 (uint64 seed=0) const noexcept
 
bool HasWildcards () const noexcept
 
size_type IndexAt (const_iterator i) const noexcept
 
void Insert (size_type i, char_type c, size_type n=1)
 
template<class R1 , class A1 >
void Insert (size_type i, const GenericString< T, R1, A1 > &s)
 
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, const_iterator p, const_iterator q)
 
bool IsAliasOf (const GenericString &s) const noexcept
 
bool IsEmpty () const noexcept
 
bool IsNumeral () const noexcept
 
bool IsSymbol () const noexcept
 
bool IsUnique () const noexcept
 
bool IsValid () const noexcept
 
bool IsValidIdentifier () const noexcept
 
bool IsValidIdentifier (distance_type &pos) const noexcept
 
void JustifyCenter (size_type width, char_type fill=R::Blank())
 
void JustifyLeft (size_type width, char_type fill=R::Blank())
 
void JustifyRight (size_type width, char_type fill=R::Blank())
 
char_type LastChar () const noexcept
 
GenericString Left (size_type n) const
 
GenericString LeftJustified (size_type width, char_type fill=R::Blank()) const
 
size_type Length () const noexcept
 
size_type LowerBound () const noexcept
 
GenericString Lowercase () const
 
char_typeoperator* ()
 
char_type operator* () const noexcept
 
GenericStringoperator+= (char_type c)
 
template<class R1 , class A1 >
GenericStringoperator+= (const GenericString< T, R1, A1 > &s)
 
GenericStringoperator+= (const_c_string t)
 
GenericStringoperator-= (char_type c)
 
template<class R1 , class A1 >
GenericStringoperator-= (const GenericString< T, R1, A1 > &s)
 
GenericStringoperator-= (const_c_string t)
 
GenericStringoperator= (char_type c)
 
GenericStringoperator= (const GenericString &s)
 
GenericStringoperator= (const_c_string t)
 
GenericStringoperator= (GenericString &&s)
 
char_typeoperator[] (size_type i)
 
char_type operator[] (size_type i) const noexcept
 
GenericString Prefix (size_type i) const
 
void Prepend (char_type c, size_type n=1)
 
template<class R1 , class A1 >
void Prepend (const GenericString< T, R1, A1 > &s)
 
void Prepend (const_c_string t)
 
void Prepend (const_c_string t, size_type n)
 
void Prepend (const_iterator i, const_iterator j)
 
c_string Release ()
 
void Replace (size_type i, size_type n, char_type c, size_type nc=1)
 
template<class R1 , class A1 >
void Replace (size_type i, size_type n, const GenericString< T, R1, A1 > &s)
 
void Replace (size_type i, size_type n, const_c_string t)
 
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)
 
template<class R1 , class A1 , class R2 , class A2 >
void ReplaceString (const GenericString< T, R1, A1 > &s1, const GenericString< T, R2, A2 > &s2, size_type i=0)
 
void ReplaceString (const_c_string t1, const_c_string t2, size_type i=0)
 
template<class R1 , class A1 , class R2 , class A2 >
void ReplaceStringIC (const GenericString< T, R1, A1 > &s1, const GenericString< T, 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 noexcept
 
GenericString Reversed () const
 
reverse_iterator ReverseEnd ()
 
const_reverse_iterator ReverseEnd () const noexcept
 
GenericString Right (size_type n) const
 
GenericString RightJustified (size_type width, char_type fill=R::Blank()) const
 
void SecureFill (char c='\0') noexcept
 
void SetAllocator (const allocator &a)
 
void SetLength (size_type n)
 
GenericString SetToLength (size_type n) const
 
GenericString SingleQuoted () const
 
size_type Size () const noexcept
 
void Sort ()
 
template<class BP >
void Sort (BP p)
 
GenericString Sorted () const
 
template<class BP >
GenericString Sorted (BP p) const
 
void Squeeze ()
 
GenericString Squeezed () const
 
bool StartsWith (char_type c) const noexcept
 
template<class R1 , class A1 >
bool StartsWith (const GenericString< T, R1, A1 > &s) const noexcept
 
bool StartsWith (const_c_string t) const noexcept
 
bool StartsWithIC (char_type c) const noexcept
 
template<class R1 , class A1 >
bool StartsWithIC (const GenericString< T, R1, A1 > &s) const noexcept
 
bool StartsWithIC (const_c_string t) const noexcept
 
GenericString Substring (size_type i, size_type n=maxPos) const
 
GenericString Suffix (size_type i) const
 
void Swap (GenericString &s) noexcept
 
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 noexcept
 
GenericString Uppercase () const
 
template<class R1 , class A1 >
bool WildMatch (const GenericString< T, R1, A1 > &pattern, bool caseSensitive=true) const noexcept
 
bool WildMatch (const_c_string pattern, bool caseSensitive=true) const noexcept
 
template<class R1 , class A1 >
bool WildMatchIC (const GenericString< T, R1, A1 > &pattern) const noexcept
 
bool WildMatchIC (const_c_string pattern) const noexcept
 

Static Public Member Functions

static size_type BytesPerChar () noexcept
 
static size_type DeleteFreeList ()
 

Static Public Attributes

static const size_type maxPos = ~size_type( 0 )
 
static const size_type notFound = ~size_type( 0 )
 

Detailed Description

template<class T, class R, class A = PCL_STRING_ALLOCATOR>
class pcl::GenericString< T, R, A >

GenericString is a finite, ordered sequence of characters implemented as a reference-counted, dynamic array of objects of type T, whose fundamental behavior is specified by an instantiation type R of GenericCharTraits for the character type T (typically GenericCharTraits, or a derived class such as CharTraits or IsoCharTraits), and where the type A provides dynamic allocation for contiguous sequences of elements of type T (StandardAllocator is used by default).

On the PixInsight platform, all dynamically allocated strings have been implemented as two instantiations of the GenericString template class, namely the String (UTF-16 string) and IsoString (UTF-8 or ISO/IEC-8859-1 string) classes.

See also
String, IsoString, CharTraits, IsoCharTraits

Definition at line 492 of file String.h.

Member Typedef Documentation

◆ allocator

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::allocator = pcl::Allocator<T,A>

The allocator class used by this string class.

Definition at line 514 of file String.h.

◆ block_allocator

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::block_allocator = A

The block allocator used by this string class.

Definition at line 509 of file String.h.

◆ c_string

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::c_string = T*

Null-terminated string of char_type characters.

Definition at line 519 of file String.h.

◆ char_traits

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::char_traits = R

The character traits class used by this string class.

Definition at line 504 of file String.h.

◆ char_type

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::char_type = T

Represents a string character.

Definition at line 499 of file String.h.

◆ const_c_string

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::const_c_string = const T*

Immutable null-terminated string of char_type characters.

Definition at line 524 of file String.h.

◆ const_iterator

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::const_iterator = const T*

Immutable string iterator.

Definition at line 534 of file String.h.

◆ const_reverse_iterator

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::const_reverse_iterator = ReverseRandomAccessIterator<const_iterator, const T>

Reverse immutable string iterator.

Definition at line 544 of file String.h.

◆ iterator

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::iterator = T*

String iterator.

Definition at line 529 of file String.h.

◆ reverse_iterator

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
using pcl::GenericString< T, R, A >::reverse_iterator = ReverseRandomAccessIterator<iterator, T>

Reverse string iterator.

Definition at line 539 of file String.h.

Constructor & Destructor Documentation

◆ GenericString() [1/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( )
inline

Constructs an empty string.

Definition at line 563 of file String.h.

◆ GenericString() [2/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( const GenericString< T, R, A > &  s)
inline

Copy constructor. Increments the reference counter of the string s.

Definition at line 571 of file String.h.

◆ GenericString() [3/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( GenericString< T, R, A > &&  s)
inline

Move constructor.

Definition at line 580 of file String.h.

◆ GenericString() [4/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( const_c_string  t)
inline

Constructs a string with a copy of the null-terminated character sequence stored in the specified array t.

Definition at line 590 of file String.h.

◆ GenericString() [5/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( const_iterator  i,
const_iterator  j 
)
inline

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

If i is greater than or equal to j, this constructor creates an empty string. Otherwise it will assign the specified sequence of characters.

Important - Note that this constructor is not equivalent to:

GenericString( i, 0, j-i );

because the above call would assign a null-terminated sequence, while this function assigns the specified range unconditionally, even if it contains null characters. Since this constructor does not have to scan for a terminating character, it is potentially more efficient.

Definition at line 619 of file String.h.

◆ GenericString() [6/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( std::initializer_list< char_type l)
inline

Constructs a string and initializes it with characters taken from the specified initializer list l.

This constructor is equivalent to:

GenericString( l.begin(), l.end() )

Definition at line 639 of file String.h.

◆ GenericString() [7/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( const_c_string  t,
size_type  i,
size_type  n 
)
inline

Constructs a string with a copy of at most n characters stored in the null-terminated sequence t, starting from its i-th character.

Definition at line 648 of file String.h.

◆ GenericString() [8/8]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::GenericString ( char_type  c,
size_type  n = 1 
)
inline

Constructs a string with n copies of a character c.

Definition at line 663 of file String.h.

◆ ~GenericString()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
pcl::GenericString< T, R, A >::~GenericString ( )
inline

Destroys this string. Decrements the reference counter of the string data and, if it becomes unreferenced, it is destroyed and deallocated.

Definition at line 678 of file String.h.

Member Function Documentation

◆ Add() [1/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Add ( char_type  c,
size_type  n = 1 
)
inline

A synonym for Append( char_type, size_type ), provided for compatibility with PCL container classes.

Definition at line 1852 of file String.h.

◆ Add() [2/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
void pcl::GenericString< T, R, A >::Add ( const GenericString< T, R1, A1 > &  s)
inline

A synonym for Append( const GenericString& ), provided for compatibility with PCL container classes.

Definition at line 1816 of file String.h.

◆ Add() [3/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Add ( const_c_string  t)
inline

A synonym for Append( const_c_string ), provided for compatibility with PCL container classes.

Definition at line 1843 of file String.h.

◆ Add() [4/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Add ( const_c_string  t,
size_type  n 
)
inline

A synonym for Append( const_c_string, size_type ), provided for compatibility with PCL container classes.

Definition at line 1834 of file String.h.

◆ Add() [5/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Add ( const_iterator  i,
const_iterator  j 
)
inline

A synonym for Append( const_iterator, const_iterator ), provided for compatibility with PCL container classes.

Definition at line 1825 of file String.h.

◆ Allocator()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const allocator& pcl::GenericString< T, R, A >::Allocator ( ) const
inlinenoexcept

Returns a reference to the (immutable) allocator object in this string.

See also
SetAllocator()

Definition at line 855 of file String.h.

◆ Append() [1/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Append ( char_type  c,
size_type  n = 1 
)
inline

Appends n copies of a character c to this string.

Definition at line 1806 of file String.h.

◆ Append() [2/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
void pcl::GenericString< T, R, A >::Append ( const GenericString< T, R1, A1 > &  s)
inline

Appends a copy of the specified string s to this string.

Definition at line 1748 of file String.h.

Referenced by pcl::operator+(), and pcl::operator<<().

◆ Append() [3/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Append ( const_c_string  t)
inline

Appends a copy of a null-terminated character sequence to this string.

Definition at line 1788 of file String.h.

◆ Append() [4/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Append ( const_c_string  t,
size_type  n 
)
inline

Appends a copy of the first n characters of a null-terminated character sequence t to this string.

Definition at line 1780 of file String.h.

◆ Append() [5/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Append ( const_iterator  i,
const_iterator  j 
)
inline

Appends a copy of the character sequence defined by the range [i,j) to this string.

If i is greater than or equal to j, calling this member function has no effect.

Definition at line 1771 of file String.h.

◆ Assign() [1/7]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Assign ( char_type  c,
size_type  n = 1 
)
inline

Assigns n copies of the specified character c to this string. If either c is the null character or n is zero, this function empties the string by calling Clear().

Definition at line 1352 of file String.h.

◆ Assign() [2/7]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Assign ( const GenericString< T, R, A > &  s)
inline

Assigns a string s to this string.

If this instance and the specified source instance s reference different string data, then the data previously referenced by this object is dereferenced. If the previous data becomes unreferenced, it is destroyed and deallocated. Then the data being referenced by s is also referenced by this object.

If this instance and the specified source instance s already reference the same string data, then this function does nothing.

See also
Transfer()

Definition at line 1181 of file String.h.

◆ Assign() [3/7]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Assign ( const GenericString< T, R, A > &  s,
size_type  i,
size_type  n 
)
inline

Assigns a substring of at most n characters from a source string s, starting from its i-th character, to this string.

Definition at line 1255 of file String.h.

◆ Assign() [4/7]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Assign ( const_c_string  t)
inline

Assigns a copy of the null-terminated character sequence stored in the specified array t to this string.

If t is a pointer to the contents of this string (or, equivalently, an iterator on this string), this function invokes undefined behavior.

Definition at line 1267 of file String.h.

◆ Assign() [5/7]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Assign ( const_c_string  t,
size_type  i,
size_type  n 
)
inline

Assigns a copy of at most n characters stored in the null-terminated sequence t, starting from its i-th character, to this string.

If t is the null pointer, or i is greater than the length of t, or n is zero, this function empties the string by calling Clear().

If t is a pointer to the contents of this string (or, equivalently, an iterator on this string), this function invokes undefined behavior.

The character count n will be constrained to copy existing characters from the null-terminated source sequence.

Definition at line 1335 of file String.h.

◆ Assign() [6/7]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Assign ( const_iterator  i,
const_iterator  j 
)
inline

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

If i is greater than or equal to j, this function empties the string by calling Clear(). Otherwise this function will assign the specified sequence of characters.

If i and/or j are iterators on this string, this function invokes undefined behavior.

Important - Note that this function is not equivalent to:

Assign( i, 0, j-i );

because the above call would assign a null-terminated sequence, while this function assigns the specified range unconditionally, even if it contains null characters. Since this function does not have to scan for a terminating character, it is potentially much more efficient.

Definition at line 1299 of file String.h.

◆ Assign() [7/7]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::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 1317 of file String.h.

◆ At() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
iterator pcl::GenericString< T, R, A >::At ( size_type  i)
inline

Returns an iterator located at the i-th character of this string. The character index i must be in the range [0,Length()).

If this string is not unique, it is made unique before returning from this member function.

If this string is empty, or if the specified index i is out of range, calling this member function is an error that leads to an invalid result.

See also
operator []( size_type )

Definition at line 887 of file String.h.

◆ At() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_iterator pcl::GenericString< T, R, A >::At ( size_type  i) const
inlinenoexcept

Returns an immutable iterator located at the i-th character in this string. The character index i must be in the range [0,Length()).

If this string is empty, or if the specified index i is out of range, calling this member function is an error that leads to an invalid result.

See also
operator []( size_type ) const

Definition at line 903 of file String.h.

◆ Available()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::Available ( ) const
inlinenoexcept

Returns the number of characters available in this string.

The number of available characters is equal to Capacity() - Length().

See also
Capacity(), Length(), Size()

Definition at line 785 of file String.h.

◆ Begin() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
iterator pcl::GenericString< T, R, A >::Begin ( )
inline

Returns a mutable iterator pointing to the first character of this string.

If this string is not unique, it is made unique before returning from this member function.

If this string is empty, this member function returns nullptr.

See also
End()

Definition at line 976 of file String.h.

Referenced by pcl::AES256::AES256(), pcl::String::Assign(), pcl::XML::IsValidName(), pcl::IsoString::operator=(), pcl::File::OutText(), pcl::XML::ReferenceValue(), and pcl::IsoString::ToString().

◆ begin() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
iterator pcl::GenericString< T, R, A >::begin ( )
inline

STL-compatible iteration. Equivalent to Begin().

Definition at line 1113 of file String.h.

◆ Begin() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_iterator pcl::GenericString< T, R, A >::Begin ( ) const
inlinenoexcept

Returns an immutable iterator pointing to the first character of this string.

If this string is empty, this member function returns nullptr.

See also
End() const

Definition at line 990 of file String.h.

◆ begin() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_iterator pcl::GenericString< T, R, A >::begin ( ) const
inlinenoexcept

STL-compatible iteration. Equivalent to Begin() const.

Definition at line 1121 of file String.h.

◆ Break() [1/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class C >
size_type pcl::GenericString< T, R, A >::Break ( C &  list,
char_type  c,
bool  trim = false,
size_type  i = 0 
) const
inline

Gets a sequence of tokens (substrings) extracted from this string.

Parameters
[out]listThe list of extracted tokens. Must be a reference to a container, such as Array or List, or a derived class. Typically, this parameter is a reference to a StringList.
cThe token separator character. Tokens will be separated by sequences of one or more instances of this character.
trimTrue to trim the extracted tokens. If this parameter is true, existing leading and trailing whitespace characters will be removed from each extracted token.
iStarting character index.

Returns the number of tokens extracted and added to the list.

Definition at line 2500 of file String.h.

◆ Break() [2/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class C , typename S >
size_type pcl::GenericString< T, R, A >::Break ( C &  list,
const Array< S > &  ca,
bool  trim = false,
size_type  i = 0 
) const
inline

Gets a sequence of tokens (substrings) extracted from this string.

Parameters
[out]listThe list of extracted tokens. Must be a reference to a container, such as Array or List, or a derived class. Typically, this parameter is a reference to a StringList.
caAn array of token separator characters. Tokens will be separated by instances of any character included in this array. The template argument S must have type conversion semantics to the character type of this string class (char_type). If this array is empty, calling this function has no effect and zero is returned.
trimTrue to trim the extracted tokens. If this parameter is true, existing leading and trailing whitespace characters will be removed from each extracted token.
iStarting character index.

Returns the number of tokens extracted and added to the list.

Definition at line 2565 of file String.h.

◆ Break() [3/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class C , class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::Break ( C &  list,
const GenericString< T, R1, A1 > &  s,
bool  trim = false,
size_type  i = 0 
) const
inline

Gets a sequence of tokens (substrings) extracted from this string.

Parameters
[out]listThe list of extracted tokens. Must be a reference to a container, such as Array or List, or a derived class. Typically, this parameter is a reference to a StringList.
sThe token separator string.
trimTrue to trim the extracted tokens. If this parameter is true, existing leading and trailing whitespace characters will be removed from each extracted token.
iStarting character index.

Returns the number of tokens extracted and added to the list.

Definition at line 2380 of file String.h.

◆ Break() [4/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class C >
size_type pcl::GenericString< T, R, A >::Break ( C &  list,
const_c_string  s,
bool  trim = false,
size_type  i = 0 
) const
inline

Gets a sequence of tokens (substrings) extracted from this string.

Parameters
[out]listThe list of extracted tokens. Must be a reference to a container, such as Array or List, or a derived class. Typically, this parameter is a reference to a StringList.
sThe token separator null-terminated string.
trimTrue to trim the extracted tokens. If this parameter is true, existing leading and trailing whitespace characters will be removed from each extracted token.
iStarting character index.

Returns the number of tokens extracted and added to the list.

Definition at line 2440 of file String.h.

◆ BreakIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class C >
size_type pcl::GenericString< T, R, A >::BreakIC ( C &  list,
char_type  c,
bool  trim = false,
size_type  i = 0 
) const
inline

Gets a sequence of tokens (substrings) extracted from this string by performing case-insensitive comparisons with a token separator character.

Parameters
[out]listThe list of extracted tokens. Must be a reference to a container, such as Array or List, or a derived class. Typically, this parameter is a reference to a StringList.
cThe token separator character. Tokens will be separated by sequences of one or more instances of this character. This function performs case-insensitive character comparisons to locate instances of this character.
trimTrue to trim the extracted tokens. If this parameter is true, existing leading and trailing whitespace characters will be removed from each extracted token.
iStarting character index.

Returns the number of tokens extracted and added to the list.

Definition at line 2763 of file String.h.

◆ BreakIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class C , class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::BreakIC ( C &  list,
const GenericString< T, R1, A1 > &  s,
bool  trim = false,
size_type  i = 0 
) const
inline

Gets a sequence of tokens (substrings) extracted from this string by performing case-insensitive comparisons with a token separation string.

Parameters
[out]listThe list of extracted tokens. Must be a reference to a container, such as Array or List, or a derived class. Typically, this parameter is a reference to a StringList.
sThe token separator string. This function performs case-insensitive string comparisons to locate instances of this string.
trimTrue to trim the extracted tokens. If this parameter is true, existing leading and trailing whitespace characters will be removed from each extracted token.
iStarting character index.

Returns the number of tokens extracted and added to the list.

Definition at line 2632 of file String.h.

◆ BreakIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class C >
size_type pcl::GenericString< T, R, A >::BreakIC ( C &  list,
const_c_string  s,
bool  trim = false,
size_type  i = 0 
) const
inline

Gets a sequence of tokens (substrings) extracted from this string by performing case-insensitive comparisons with a null-terminated token separation string.

Parameters
[out]listThe list of extracted tokens. Must be a reference to a container, such as Array or List, or a derived class. Typically, this parameter is a reference to a StringList.
sThe token separator null-terminated string. This function performs case-insensitive string comparisons to locate instances of this string.
trimTrue to trim the extracted tokens. If this parameter is true, existing leading and trailing whitespace characters will be removed from each extracted token.
iStarting character index.

Returns the number of tokens extracted and added to the list.

Definition at line 2698 of file String.h.

◆ BytesPerChar()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
static size_type pcl::GenericString< T, R, A >::BytesPerChar ( )
inlinestaticnoexcept

Returns the number of bytes necessary to store a single character in this string.

This member function returns the R::BytesPerChar() static member function of the char traits class R.

Definition at line 738 of file String.h.

◆ c_copy()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::c_copy ( iterator  dst,
size_type  maxCharsToCopy,
size_type  i = 0 
) const
inlinenoexcept

Copies characters from this string to a null-terminated character array.

Parameters
[out]dstDestination character array.
maxCharsToCopyThe total number of characters that can be stored at the dst array, including a null terminating character.
iIndex of the first character to be copied from this string.

This function copies at most maxCharsToCopy-1 characters from this string (or Length()-i, whichever is less) to the dst array. Then a null terminating character is appended to dst.

Definition at line 1654 of file String.h.

◆ c_str()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_c_string pcl::GenericString< T, R, A >::c_str ( ) const
inlinenoexcept

Returns a pointer to the immutable internal data array of this string.

If this string is empty, this member function returns a pointer to a static, null-terminated, unmodifiable empty string (the "" C string). This function always returns a valid pointer to existing character data.

Definition at line 1150 of file String.h.

Referenced by pcl::Argument::Argument().

◆ Capacity()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::Capacity ( ) const
inlinenoexcept

Returns the total capacity of this string in characters.

The capacity of a string is the maximum number of characters that can be stored before requiring a reallocation of string data.

See also
Available(), Length(), Size()

Definition at line 773 of file String.h.

◆ CaseFolded()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::CaseFolded ( ) const
inline

Returns a duplicate of this string with all characters replaced with their case folded counterparts.

Definition at line 4017 of file String.h.

◆ CenterJustified()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::CenterJustified ( size_type  width,
char_type  fill = R::Blank() 
) const
inline

Returns a duplicate of this string padded equally to the left and right, using the specified fill character, up to the specified width.

See also
JustifyCenter(), LeftJustified(), RightJustified()

Definition at line 3603 of file String.h.

◆ Clear()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Clear ( )
inline

Removes all characters in this string, yielding an empty string.

If this string is empty, then calling this member function has no effect.

If this string uniquely references its string data, it is destroyed and deallocated; otherwise its reference counter is decremented. Then a new, empty string data structure is created and uniquely referenced.

Definition at line 2258 of file String.h.

Referenced by pcl::ProcessInterface::ValidateProcess().

◆ Compare() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
int pcl::GenericString< T, R, A >::Compare ( char_type  c,
bool  caseSensitive = true,
bool  localeAware = true 
) const
inlinenoexcept

Lexicographical comparison to a single character.

Parameters
cA character to which this string will be compared.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters (as defined by the selected locale). The default value of this parameter is true.
localeAwareWhen true, a locale-dependent comparison is done which takes into account the currently selected user locale (language and variants). When false, a locale-invariant comparison is carried out by comparing character code points (which is faster). The default value of this parameter is true.

Performs a comparison between this string and the specified character c, and returns an integer that indicates the comparison result:

  • 0 if this string is equal to c.
  • +1 if this string postcedes the character c.
  • -1 if this string precedes the character c.

The performed comparison is equivalent to a comparison of this string with a fictitious string of length one, whose only character was equal to the specified character c.

Definition at line 3794 of file String.h.

◆ Compare() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
int pcl::GenericString< T, R, A >::Compare ( const GenericString< T, R1, A1 > &  s,
bool  caseSensitive = true,
bool  localeAware = true 
) const
inlinenoexcept

Lexicographical comparison between two strings.

Parameters
sA string to which this string will be compared.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters (as defined by the selected locale). The default value of this parameter is true.
localeAwareWhen true, a locale-dependent comparison is done which takes into account the currently selected user locale (language and variants). When false, a locale-invariant comparison is carried out by comparing character code points (which is faster). The default value of this parameter is true.

Performs a character-to-character comparison between this string and the specified string s, and returns an integer that indicates the comparison result:

  • 0 if both strings are equal.
  • +1 if this string postcedes the specified string s.
  • -1 if this string precedes the specified string s.

Definition at line 3727 of file String.h.

◆ Compare() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
int pcl::GenericString< T, R, A >::Compare ( const_c_string  t,
bool  caseSensitive = true,
bool  localeAware = true 
) const
inlinenoexcept

Lexicographical comparison to a null-terminated string.

Parameters
tThe starting address of a null-terminated string to which this string will be compared.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters (as defined by the selected locale). The default value of this parameter is true.
localeAwareWhen true, a locale-dependent comparison is done which takes into account the currently selected user locale (language and variants). When false, a locale-invariant comparison is carried out by comparing character code points (which is faster). The default value of this parameter is true.

Performs a character-to-character comparison between this string and the specified null-terminated string t, and returns an integer that indicates the comparison result:

  • 0 if both strings are equal.
  • +1 if this string postcedes the specified string t.
  • -1 if this string precedes the specified string t.

Definition at line 3760 of file String.h.

◆ CompareCodePoints() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
int pcl::GenericString< T, R, A >::CompareCodePoints ( char_type  c,
bool  caseSensitive = true 
) const
inlinenoexcept

Compares numeric character values a string and a null-terminated string.

Parameters
cA single character to which this string will be compared.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters. The default value of this parameter is true.

Performs a comparison between this string and the specified character c, and returns an integer that indicates the comparison result:

  • 0 if this string is equal to c.
  • +1 if this string postcedes the character c.
  • -1 if this string precedes the character c.

The performed comparison is equivalent to a comparison of this string with a fictitious string of length one, whose only character was equal to the specified character c.

This function ignores the current platform locale. It considers Unicode code points exclusively. For case-insensitive comparisons, a standard Unicode case folding transformation is applied to each character pair.

Definition at line 3695 of file String.h.

◆ CompareCodePoints() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
int pcl::GenericString< T, R, A >::CompareCodePoints ( const GenericString< T, R1, A1 > &  s,
bool  caseSensitive = true 
) const
inlinenoexcept

Compares numeric character values between two strings.

Parameters
sA string to which this string will be compared.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters. The default value of this parameter is true.

Performs a character-to-character comparison of numeric character values between this string and the specified string s, and returns an integer that indicates the comparison result:

  • 0 if both strings are equal.
  • +1 if this string postcedes the specified string s.
  • -1 if this string precedes the specified string s.

This function ignores the current platform locale. It considers Unicode code points exclusively. For case-insensitive comparisons, a standard Unicode case folding transformation is applied to each character pair.

Definition at line 3634 of file String.h.

◆ CompareCodePoints() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
int pcl::GenericString< T, R, A >::CompareCodePoints ( const_c_string  t,
bool  caseSensitive = true 
) const
inlinenoexcept

Compares numeric character values a string and a null-terminated string.

Parameters
tThe starting address of a null-terminated string to which this string will be compared.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters. The default value of this parameter is true.

Performs a character-to-character comparison of numeric character values between this string and the specified null-terminated string t, and returns an integer that indicates the comparison result:

  • 0 if both strings are equal.
  • +1 if this string postcedes the specified string t.
  • -1 if this string precedes the specified string t.

This function ignores the current platform locale. It considers Unicode code points exclusively. For case-insensitive comparisons, a standard Unicode case folding transformation is applied to each character pair.

Definition at line 3663 of file String.h.

◆ CompareIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
int pcl::GenericString< T, R, A >::CompareIC ( char_type  c,
bool  localeAware = true 
) const
inlinenoexcept

Case-insensitive lexicographical comparison to a single character.

Parameters
cA character to which this string will be compared.
localeAwareWhen true, a locale-dependent comparison is done which takes into account the currently selected user locale (language and variants). When false, a locale-invariant comparison is carried out by comparing character code points (which is faster). The default value of this parameter is true.

Performs a case-insensitive comparison between this string and the specified character c, and returns an integer that indicates the comparison result:

  • 0 if this string is equal to c.
  • +1 if this string postcedes the character c.
  • -1 if this string precedes the character c.

The performed comparison is equivalent to a case-insensitive comparison of this string with a fictitious string of length one, whose only character was equal to c.

Definition at line 3875 of file String.h.

◆ CompareIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
int pcl::GenericString< T, R, A >::CompareIC ( const GenericString< T, R1, A1 > &  s,
bool  localeAware = true 
) const
inlinenoexcept

Case-insensitive lexicographical comparison between two strings.

Parameters
sA string to which this string will be compared.
localeAwareWhen true, a locale-dependent comparison is done which takes into account the currently selected user locale (language and variants). When false, a locale-invariant comparison is carried out by comparing character code points (which is faster). The default value of this parameter is true.

Performs a character-to-character, case-insensitive comparison between this string and the specified string s, and returns an integer that indicates the comparison result:

  • 0 if both strings are equal.
  • +1 if this string postcedes the specified string s.
  • -1 if this string precedes the specified string s.

Definition at line 3820 of file String.h.

Referenced by pcl::EphemerisConstant::operator<(), pcl::operator<(), pcl::EphemerisConstant::operator==(), and pcl::operator==().

◆ CompareIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
int pcl::GenericString< T, R, A >::CompareIC ( const_c_string  t,
bool  localeAware = true 
) const
inlinenoexcept

Case-insensitive lexicographical comparison to a null-terminated string.

Parameters
tThe starting address of a null-terminated string to which this string will be compared.
localeAwareWhen true, a locale-dependent comparison is done which takes into account the currently selected user locale (language and variants). When false, a locale-invariant comparison is carried out by comparing character code points (which is faster). The default value of this parameter is true.

Performs a character-to-character, case-insensitive comparison between this string and the specified null-terminated string t, and returns an integer that indicates the comparison result:

  • 0 if both strings are equal.
  • +1 if this string postcedes the specified string s.
  • -1 if this string precedes the specified string s.

Definition at line 3846 of file String.h.

◆ Contains() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::Contains ( char_type  c) const
inlinenoexcept

Returns true iff this string contains a character c.

Definition at line 3238 of file String.h.

◆ Contains() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::Contains ( const GenericString< T, R1, A1 > &  s) const
inlinenoexcept

Returns true iff this string contains a substring s.

Definition at line 3222 of file String.h.

◆ Contains() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::Contains ( const_c_string  t) const
inlinenoexcept

Returns true iff this string contains a null-terminated substring t.

Definition at line 3230 of file String.h.

◆ ContainsIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::ContainsIC ( char_type  c) const
inlinenoexcept

Returns true iff this string contains a character c.

This member function performs case-insensitive character comparisons to find an instance of the specified character c.

Definition at line 3272 of file String.h.

◆ ContainsIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::ContainsIC ( const GenericString< T, R1, A1 > &  s) const
inlinenoexcept

Returns true iff this string contains a substring s.

This member function performs case-insensitive string comparisons to find an instance of the specified substring s.

Definition at line 3250 of file String.h.

◆ ContainsIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::ContainsIC ( const_c_string  t) const
inlinenoexcept

Returns true iff this string contains a null-terminated substring t.

This member function performs case-insensitive string comparisons to find an instance of the specified substring t.

Definition at line 3261 of file String.h.

◆ Delete()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Delete ( size_type  i,
size_type  n = 1 
)
inline

Deletes a contiguous segment of at most n characters starting at the i-th character in this string.

Definition at line 2129 of file String.h.

◆ DeleteChar()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::DeleteChar ( char_type  c,
size_type  i = 0 
)
inline

Deletes all occurrences of the c character in a segment of contiguous characters starting from the i-th character and spanning to the end of this string.

Definition at line 2186 of file String.h.

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

◆ DeleteCharIC()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::DeleteCharIC ( char_type  c,
size_type  i = 0 
)
inline

Deletes all occurrences of the c character in a segment of contiguous characters starting from the i-th character and spanning to the end of this string.

This member function performs case-insensitive character comparisons.

Definition at line 2198 of file String.h.

◆ DeleteFreeList()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
static size_type pcl::GenericString< T, R, A >::DeleteFreeList ( )
inlinestatic

If the internal free list of string data structures is available, this function destroys it and returns the number of deleted structures. Otherwise the function has no effect and returns zero.

Note
This function is not thread-safe.

Definition at line 4266 of file String.h.

◆ DeleteLeft()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::DeleteLeft ( size_type  i)
inline

Deletes the initial segment of at most i contiguous characters in this string.

Definition at line 2176 of file String.h.

◆ DeleteRight()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::DeleteRight ( size_type  i)
inline

Deletes a segment of contiguous characters starting from the i-th character and spanning to the end of this string.

Definition at line 2167 of file String.h.

◆ DeleteString() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
void pcl::GenericString< T, R, A >::DeleteString ( const GenericString< T, R1, A1 > &  s,
size_type  i = 0 
)
inline

Deletes all occurrences of a string s in a segment of contiguous characters starting from the i-th character and spanning to the end of this string.

Definition at line 2209 of file String.h.

◆ DeleteString() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::DeleteString ( const_c_string  t,
size_type  i = 0 
)
inline

Deletes all occurrences of a null-terminated string s in a segment of contiguous characters starting from the i-th character and spanning to the end of this string.

Definition at line 2219 of file String.h.

◆ DeleteStringIC() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
void pcl::GenericString< T, R, A >::DeleteStringIC ( const GenericString< T, R1, A1 > &  s,
size_type  i = 0 
)
inline

Deletes all occurrences of a string s in a segment of contiguous characters starting from the i-th character and spanning to the end of this string.

This member function performs case-insensitive string comparisons.

Definition at line 2232 of file String.h.

◆ DeleteStringIC() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::DeleteStringIC ( const_c_string  t,
size_type  i = 0 
)
inline

Deletes all occurrences of a null-terminated string s in a segment of contiguous characters starting from the i-th character and spanning to the end of this string.

This member function performs case-insensitive string comparisons.

Definition at line 2244 of file String.h.

◆ DoubleQuoted()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::DoubleQuoted ( ) const
inline

Returns a duplicate of this string enclosed by double quote characters ("). If this string is already double quoted, this function returns an unmodified copy.

See also
EnsureDoubleQuoted()

Definition at line 3460 of file String.h.

◆ Enclosed()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Enclosed ( char_type  c) const
inline

Returns a duplicate of this string enclosed by the specified character. If this string is already enclosed by c, this function returns an unmodified copy.

See also
EnsureEnclosed()

Definition at line 3412 of file String.h.

◆ End() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
iterator pcl::GenericString< T, R, A >::End ( )
inline

Returns a mutable iterator pointing to the end of this string. The returned iterator points to the next-to-last character of this string.

If this string is not unique, it is made unique before returning from this member function.

If this string is empty, this member function returns nullptr.

See also
Begin()

Definition at line 1006 of file String.h.

Referenced by pcl::XML::IsValidName(), pcl::File::OutText(), and pcl::XML::ReferenceValue().

◆ end() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
iterator pcl::GenericString< T, R, A >::end ( )
inline

STL-compatible iteration. Equivalent to End().

Definition at line 1129 of file String.h.

◆ End() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_iterator pcl::GenericString< T, R, A >::End ( ) const
inlinenoexcept

Returns an immutable iterator pointing to the end of this string. The returned iterator points to the next-to-last character of this string.

If this string is empty, this member function returns nullptr.

See also
Begin() const

Definition at line 1020 of file String.h.

◆ end() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_iterator pcl::GenericString< T, R, A >::end ( ) const
inlinenoexcept

STL-compatible iteration. Equivalent to End() const.

Definition at line 1137 of file String.h.

◆ EndsWith() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::EndsWith ( char_type  c) const
inlinenoexcept

Returns true iff this string ends with the specified character c.

Definition at line 2933 of file String.h.

◆ EndsWith() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::EndsWith ( const GenericString< T, R1, A1 > &  s) const
inlinenoexcept

Returns true iff this string ends with the specified substring s.

Definition at line 2904 of file String.h.

◆ EndsWith() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::EndsWith ( const_c_string  t) const
inlinenoexcept

Returns true iff this string ends with the specified null-terminated string t.

Definition at line 2919 of file String.h.

◆ EndsWithIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::EndsWithIC ( char_type  c) const
inlinenoexcept

Returns true iff this string ends with the specified character c, performing a case-insensitive character comparison.

Definition at line 2973 of file String.h.

◆ EndsWithIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::EndsWithIC ( const GenericString< T, R1, A1 > &  s) const
inlinenoexcept

Returns true iff this string ends with the specified substring s, performing case-insensitive character comparisons.

Definition at line 2943 of file String.h.

◆ EndsWithIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::EndsWithIC ( const_c_string  t) const
inlinenoexcept

Returns true iff this string ends with the specified null-terminated string t, performing case-insensitive character comparisons.

Definition at line 2958 of file String.h.

◆ EnsureDoubleQuoted()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::EnsureDoubleQuoted ( )
inline

Ensures that this string is enclosed by a leading and a trailing instance of the double quote character ("). If this string is already double quoted, this function does nothing.

See also
DoubleQuoted()

Definition at line 3449 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::DoubleQuoted().

◆ EnsureEnclosed()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::EnsureEnclosed ( char_type  c)
inline

Ensures that this string is enclosed by a leading and a trailing instance of the specified character c. If this string is already enclosed by c, this function does nothing.

See also
Enclosed()

Definition at line 3368 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Enclosed().

◆ EnsureSingleQuoted()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::EnsureSingleQuoted ( )
inline

Ensures that this string is enclosed by a leading and a trailing instance of the single quote character ('). If this string is already single quoted, this function does nothing.

See also
SingleQuoted()

Definition at line 3425 of file String.h.

Referenced by pcl::FITSHeaderKeyword::FixValueDelimiters(), and pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::SingleQuoted().

◆ EnsureUnique()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::EnsureUnique ( )
inline

Ensures that this string uniquely references its string data.

If necessary, this member function generates a duplicate of the string data, references it, and then decrements the reference counter of the original string data.

See also
IsUnique(), IsAliasOf()

Definition at line 718 of file String.h.

◆ Fill() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Fill ( char_type  c)
inline

Fills this string (if not empty) with the specified character c.

Note
The null terminating character can legally be specified as a filling character with this function. In this case the internal string pointer will be seen as an empty string by C library routines (such as strlen or strcpy) and other applications after calling this function, although it will continue storing the same allocated data block.

Definition at line 1380 of file String.h.

◆ Fill() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Fill ( char_type  c,
size_type  i,
size_type  n = maxPos 
)
inline

Fills a segment of at most n contiguous characters in this string with the specified character c, starting from the i-th character.

If i is greater than or equal to the length of this string, then calling this function has no effect. Otherwise the character count n will be constrained to replace existing characters in this string.

Note
The null terminating character can legally be specified as a filling character with this function. In this case the internal string pointer will be seen as an empty string by C library routines (such as strlen or strcpy) and other applications after calling this function, although it will continue storing the same allocated data block.

Definition at line 1409 of file String.h.

◆ Find() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::Find ( char_type  c,
size_type  i = 0 
) const
inlinenoexcept

A synonym for FindFirst( char_type, size_type ).

Definition at line 3084 of file String.h.

◆ Find() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::Find ( const GenericString< T, R1, A1 > &  s,
size_type  i = 0 
) const
inlinenoexcept

A synonym for FindFirst( const GenericString<T,R1,A1>&, size_type ).

Definition at line 3068 of file String.h.

◆ Find() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::Find ( const_c_string  t,
size_type  i = 0 
) const
inlinenoexcept

A synonym for FindFirst( const_c_string, size_type ).

Definition at line 3076 of file String.h.

◆ FindFirst() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindFirst ( char_type  c,
size_type  i = 0 
) const
inlinenoexcept

Returns the index k of the first occurrence of a character c in this string, such that k >= i. Returns notFound if such occurrence does not exist.

Definition at line 3008 of file String.h.

◆ FindFirst() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::FindFirst ( const GenericString< T, R1, A1 > &  s,
size_type  i = 0 
) const
inlinenoexcept

Returns the starting index k of the first occurrence of a substring s in this string, such that k >= i. Returns notFound if such occurrence does not exist.

Definition at line 2984 of file String.h.

◆ FindFirst() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindFirst ( const_c_string  t,
size_type  i = 0 
) const
inlinenoexcept

Returns the starting index k of the first occurrence of a null-terminated substring t in this string, such that k >= i. Returns notFound if such occurrence does not exist.

Definition at line 2996 of file String.h.

◆ FindFirstIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindFirstIC ( char_type  c,
size_type  i = 0 
) const
inlinenoexcept

Returns the index k of the first occurrence of a character c in this string, such that k >= i. Returns notFound if such occurrence does not exist.

This member function performs case-insensitive character comparisons to find an instance of the character c.

Definition at line 3055 of file String.h.

◆ FindFirstIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::FindFirstIC ( const GenericString< T, R1, A1 > &  s,
size_type  i = 0 
) const
inlinenoexcept

Returns the starting index k of the first occurrence of a substring s in this string, such that k >= i. Returns notFound if such occurrence does not exist.

This member function performs case-insensitive string comparisons to find an instance of the substring s.

Definition at line 3025 of file String.h.

◆ FindFirstIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindFirstIC ( const_c_string  t,
size_type  i = 0 
) const
inlinenoexcept

Returns the starting index k of the first occurrence of a null-terminated substring s in this string, such that k >= i. Returns notFound if such occurrence does not exist.

This member function performs case-insensitive string comparisons to find an instance of the substring s.

Definition at line 3040 of file String.h.

◆ FindIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindIC ( char_type  c,
size_type  i = 0 
) const
inlinenoexcept

A synonym for FindFirstIC( char_type, size_type ).

Definition at line 3109 of file String.h.

◆ FindIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::FindIC ( const GenericString< T, R1, A1 > &  s,
size_type  i = 0 
) const
inlinenoexcept

A synonym for FindFirstIC( const GenericString<T,R1,A1>&, size_type ).

Definition at line 3093 of file String.h.

◆ FindIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindIC ( const_c_string  t,
size_type  i = 0 
) const
inlinenoexcept

A synonym for FindFirstIC( const_c_string, size_type ).

Definition at line 3101 of file String.h.

◆ FindLast() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindLast ( char_type  c,
size_type  r = maxPos 
) const
inlinenoexcept

Returns the index k of the last occurrence of a character c in this string, such that k < r. Returns notFound if such occurrence does not exist.

Definition at line 3152 of file String.h.

◆ FindLast() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::FindLast ( const GenericString< T, R1, A1 > &  s,
size_type  r = maxPos 
) const
inlinenoexcept

Returns the starting index k of the last occurrence of a substring s in this string, such that:

k <= r - n,

where n is the length of the substring s. Returns notFound if such occurrence does not exist.

Definition at line 3124 of file String.h.

◆ FindLast() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindLast ( const_c_string  t,
size_type  r = maxPos 
) const
inlinenoexcept

Returns the starting index k of the last occurrence of a null-terminated substring t in this string, such that:

0 <= k <= r - n,

where n is the length of the substring t. Returns notFound if such occurrence does not exist.

Definition at line 3140 of file String.h.

◆ FindLastIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindLastIC ( char_type  c,
size_type  r = maxPos 
) const
inlinenoexcept

Returns the index k of the last occurrence of a character c in this string, such that k < r. Returns notFound if such occurrence does not exist.

This member function performs case-insensitive character comparisons to find an instance of the specified character c.

Definition at line 3208 of file String.h.

◆ FindLastIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
size_type pcl::GenericString< T, R, A >::FindLastIC ( const GenericString< T, R1, A1 > &  s,
size_type  r = maxPos 
) const
inlinenoexcept

Returns the starting index k of the last occurrence of a substring s in this string, such that:

k <= r - n,

where n is the length of the substring s. Returns notFound if such occurrence does not exist.

This member function performs case-insensitive string comparisons to find an instance of the specified substring s.

Definition at line 3174 of file String.h.

◆ FindLastIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::FindLastIC ( const_c_string  t,
size_type  r = maxPos 
) const
inlinenoexcept

Returns the starting index k of the last occurrence of a null-terminated substring t in this string, such that:

0 <= k <= r - n,

where n is the length of the substring t. Returns notFound if such occurrence does not exist.

This member function performs case-insensitive string comparisons to find an instance of the specified substring t.

Definition at line 3193 of file String.h.

◆ FirstChar()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
char_type pcl::GenericString< T, R, A >::FirstChar ( ) const
inlinenoexcept

Returns the first character in this string, or a null character (R::Null()) if this string is empty.

Definition at line 2810 of file String.h.

◆ Hash()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
uint64 pcl::GenericString< T, R, A >::Hash ( uint64  seed = 0) const
inlinenoexcept

Returns a non-cryptographic hash value computed for this string. This function is a synonym for Hash64().

Definition at line 4254 of file String.h.

◆ Hash32()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
uint32 pcl::GenericString< T, R, A >::Hash32 ( uint32  seed = 0) const
inlinenoexcept

Returns a 32-bit non-cryptographic hash value computed for this string.

This function calls pcl::Hash32() for the internal string buffer.

The seed parameter can be used to generate repeatable hash values. It can also be set to a random value in compromised environments.

Definition at line 4245 of file String.h.

Referenced by pcl::CryptographicHashFactory::CryptographicHashFactory().

◆ Hash64()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
uint64 pcl::GenericString< T, R, A >::Hash64 ( uint64  seed = 0) const
inlinenoexcept

Returns a 64-bit non-cryptographic hash value computed for this string.

This function calls pcl::Hash64() for the internal string buffer.

The seed parameter can be used to generate repeatable hash values. It can also be set to a random value in compromised environments.

Definition at line 4232 of file String.h.

◆ HasWildcards()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::HasWildcards ( ) const
inlinenoexcept

Returns true iff this string contains one or more wildcard characters (asterisk '*' or question mark '?').

Definition at line 3963 of file String.h.

◆ IndexAt()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::IndexAt ( const_iterator  i) const
inlinenoexcept

Returns the zero-based character index corresponding to a valid iterator i in this string. This is equivalent to i - Begin().

The specified iterator must be posterior to or located at the starting iterator of this string, as returned by Begin(). However, for performance reasons this condition is neither enforced nor verified. If an invalid iterator is specified, then this function, as well as any subsequent use of the returned character index, may invoke undefined behavior.

Definition at line 1103 of file String.h.

◆ Insert() [1/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Insert ( size_type  i,
char_type  c,
size_type  n = 1 
)
inline

Inserts n copies of a character c at the index i in this string.

Definition at line 1735 of file String.h.

◆ Insert() [2/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
void pcl::GenericString< T, R, A >::Insert ( size_type  i,
const GenericString< T, R1, A1 > &  s 
)
inline

Inserts a copy of the string s at the index i in this string.

Definition at line 1678 of file String.h.

◆ Insert() [3/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Insert ( size_type  i,
const_c_string  t 
)
inline

Inserts a null-terminated character sequence t at the index i in this string.

Definition at line 1709 of file String.h.

◆ Insert() [4/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Insert ( size_type  i,
const_c_string  t,
size_type  n 
)
inline

Inserts at most the first n characters of a null-terminated character sequence t at the index i in this string.

Definition at line 1723 of file String.h.

◆ Insert() [5/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Insert ( size_type  i,
const_iterator  p,
const_iterator  q 
)
inline

Inserts a copy of the character sequence defined by the range [p,q) at the index i in this string.

If p is greater than or equal to q, calling this member function has no effect.

Definition at line 1695 of file String.h.

◆ IsAliasOf()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsAliasOf ( const GenericString< T, R, A > &  s) const
inlinenoexcept

Returns true iff this string is an alias of another string s.

Two strings are aliases if both share the same string data.

See also
IsUnique(), EnsureUnique()

Definition at line 704 of file String.h.

◆ IsEmpty()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsEmpty ( ) const
inlinenoexcept

◆ IsNumeral()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsNumeral ( ) const
inlinenoexcept

Returns true iff this string can be interpreted as a numeric literal:

  • The string is not empty.
  • It is not exclusively composed of trimable characters.
  • Its first non-trimable character is either a sign character, a decimal digit, or a decimal separator.
Note
This member function does not guarantee that this string contains a valid numeric literal. It only checks for the role of this string as a token in the context of a syntactic analysis.

Definition at line 4135 of file String.h.

Referenced by pcl::FITSHeaderKeyword::IsNumeric().

◆ IsSymbol()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsSymbol ( ) const
inlinenoexcept

Returns true iff this string can be interpreted as a symbol identifier:

  • The string is not empty.
  • It is not exclusively composed of trimable characters.
  • Its first non-trimable character is either an alphabetic character or an underscore character.
Note
This member function does not guarantee that this string contains a valid symbol identifier. It only checks for the role of this string as a token in the context of a syntactic analysis.

Definition at line 4157 of file String.h.

◆ IsUnique()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsUnique ( ) const
inlinenoexcept

Returns true iff this string uniquely references its string data.

See also
EnsureUnique(), IsAliasOf()

Definition at line 692 of file String.h.

◆ IsValid()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsValid ( ) const
inlinenoexcept

Returns true only if this string is valid. A string is valid if it references an internal string structure, even if it is an empty string.

In general, all GenericString objects are valid with only two exceptions:

  • Objects that have been move-copied or move-assigned to other strings.
  • Objects that have been invalidated explicitly by calling Transfer().

An invalid string object cannot be used and should be destroyed immediately. Invalid strings are always destroyed automatically during move construction and move assignment operations.

See also
IsEmpty()

Definition at line 806 of file String.h.

◆ IsValidIdentifier() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsValidIdentifier ( ) const
inlinenoexcept

Returns true only if this string contains a valid identifier:

  • It is not an empty string.
  • Its first character is either an alphabetic character or an underscore character.
  • Its second and successive characters, if they exist, are all of them either alphabetic characters, decimal digits, or underscores.

Definition at line 4211 of file String.h.

◆ IsValidIdentifier() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::IsValidIdentifier ( distance_type pos) const
inlinenoexcept

Returns true only if this string contains a valid identifier:

  • It is not an empty string.
  • Its first character is either an alphabetic character or an underscore character.
  • Its second and successive characters, if they exist, are all of them either alphabetic characters, decimal digits, or underscores.

If this string is not a valid identifier, the pos variable will be set equal to the index of the first offending character (the first character that violates the above conditions).

Definition at line 4180 of file String.h.

◆ JustifyCenter()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::JustifyCenter ( size_type  width,
char_type  fill = R::Blank() 
)
inline

Pads this string equally to the left and right, using the specified fill character, up to the specified width.

If the current length n of this string is less than the specified width, let m = width - n, and let m2 = m/2. Then m2 copies of the fill character will be prepended to the string, and m - m2 fill characters will be appended. If the current length is greater than or equal to width, this function has no effect.

See also
JustifyLeft(), JustifyRight(), CenterJustified()

Definition at line 3559 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::CenterJustified().

◆ JustifyLeft()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::JustifyLeft ( size_type  width,
char_type  fill = R::Blank() 
)
inline

Pads this string to the right, using the specified fill character, up to the specified width.

If the current length n of this string is less than the specified width, width - n copies of the fill character will be appended to the string. If the current length is greater than or equal to width, this function has no effect.

See also
JustifyRight(), JustifyCenter(), LeftJustified()

Definition at line 3522 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::LeftJustified().

◆ JustifyRight()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::JustifyRight ( size_type  width,
char_type  fill = R::Blank() 
)
inline

Pads this string to the left, using the specified fill character, up to the specified width.

If the current length n of this string is less than the specified width, width - n copies of the fill character will be prepended to the string. If the current length is greater than or equal to width, this function has no effect.

See also
JustifyLeft(), JustifyCenter(), RightJustified()

Definition at line 3540 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::RightJustified().

◆ LastChar()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
char_type pcl::GenericString< T, R, A >::LastChar ( ) const
inlinenoexcept

Returns the last character in this string, or a null character (R::Null()) if this string is empty.

Definition at line 2819 of file String.h.

◆ Left()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Left ( size_type  n) const
inline

Returns a string with a copy of the at most n contiguous initial characters of this string.

Definition at line 2300 of file String.h.

◆ LeftJustified()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::LeftJustified ( size_type  width,
char_type  fill = R::Blank() 
) const
inline

Returns a duplicate of this string padded to the right, using the specified fill character, up to the specified width.

See also
JustifyLeft(), RightJustified(), CenterJustified()

Definition at line 3577 of file String.h.

◆ Length()

◆ LowerBound()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::LowerBound ( ) const
inlinenoexcept

Returns the minimum valid character index.

This member function exists for compatibility with PCL containers. It always returns zero.

See also
UpperBound(), Length()

Definition at line 831 of file String.h.

◆ Lowercase()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Lowercase ( ) const
inline

Returns a duplicate of this string with all uppercase characters replaced with their lowercase counterparts.

Definition at line 4028 of file String.h.

◆ operator*() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
char_type& pcl::GenericString< T, R, A >::operator* ( )
inline

Returns a reference to the first character in this string.

This is a convenience member function, equivalent to *At( 0 ).

See also
operator []( size_type ), At()

Definition at line 947 of file String.h.

◆ operator*() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
char_type pcl::GenericString< T, R, A >::operator* ( ) const
inlinenoexcept

Returns a copy of the first character in this string.

This is a convenience member function, equivalent to *At( 0 ).

See also
operator []( size_type ) const, At()

Definition at line 960 of file String.h.

◆ operator+=() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator+= ( char_type  c)
inline

Appends a copy of the specified character c to this string. Returns a reference to this object.

Definition at line 1861 of file String.h.

◆ operator+=() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
GenericString& pcl::GenericString< T, R, A >::operator+= ( const GenericString< T, R1, A1 > &  s)
inline

Appends a copy of a string by calling Append( s ). Returns a reference to this object.

Definition at line 1758 of file String.h.

◆ operator+=() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator+= ( const_c_string  t)
inline

Appends a copy of a null-terminated string by calling Append( t ). Returns a reference to this object.

Definition at line 1797 of file String.h.

◆ operator-=() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator-= ( char_type  c)
inline

Inserts a copy of the specified character c at the beginning of this string. Returns a reference to this object.

Definition at line 1940 of file String.h.

◆ operator-=() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
GenericString& pcl::GenericString< T, R, A >::operator-= ( const GenericString< T, R1, A1 > &  s)
inline

Inserts a copy of a string s at the beginning of this string. Returns a reference to this object.

Definition at line 1882 of file String.h.

◆ operator-=() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator-= ( const_c_string  t)
inline

Inserts a copy of the null-terminated sequence t at the beginning of this string. Returns a reference to this object.

Definition at line 1922 of file String.h.

◆ operator=() [1/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator= ( char_type  c)
inline

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

Definition at line 1245 of file String.h.

◆ operator=() [2/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator= ( const GenericString< T, R, A > &  s)
inline

Copy assignment operator. Returns a reference to this object.

This operator calls Assign() with the specified source string s.

Definition at line 1161 of file String.h.

◆ operator=() [3/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator= ( const_c_string  t)
inline

Assigns a copy of the null-terminated character sequence stored in the specified array t to this string. Returns a reference to this object.

Definition at line 1235 of file String.h.

◆ operator=() [4/4]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString& pcl::GenericString< T, R, A >::operator= ( GenericString< T, R, A > &&  s)
inline

Move assignment operator. Returns a reference to this object.

This operator calls Transfer() with the specified source string s.

Definition at line 1193 of file String.h.

◆ operator[]() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
char_type& pcl::GenericString< T, R, A >::operator[] ( size_type  i)
inline

Returns a reference to the i-th character in this string. The character index i must be in the range [0,Length()).

If this string is not unique, it is made unique before returning from this member function.

If this string is empty, or if the specified index i is out of range, calling this member function is an error that leads to an invalid result.

See also
At(), operator *()

Definition at line 921 of file String.h.

◆ operator[]() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
char_type pcl::GenericString< T, R, A >::operator[] ( size_type  i) const
inlinenoexcept

Returns a copy of the i-th character in this string. The character index i must be in the range [0,Length()).

If this string is empty, or if the specified index i is out of range, calling this member function is an error that leads to an invalid result.

See also
At() const, operator *() const

Definition at line 935 of file String.h.

◆ Prefix()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Prefix ( size_type  i) const
inline

Returns the prefix of this string ending at index i. Calling this member function is equivalent to:

Left( i-1 )

Definition at line 2357 of file String.h.

◆ Prepend() [1/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Prepend ( char_type  c,
size_type  n = 1 
)
inline

Inserts n copies of a character c at the beginning of this string.

Definition at line 1931 of file String.h.

◆ Prepend() [2/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
void pcl::GenericString< T, R, A >::Prepend ( const GenericString< T, R1, A1 > &  s)
inline

Inserts a copy of the specified string s at the beginning of this string.

Definition at line 1872 of file String.h.

Referenced by pcl::operator+().

◆ Prepend() [3/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Prepend ( const_c_string  t)
inline

Inserts a copy of the null-terminated character sequence t at the beginning of this string.

Definition at line 1913 of file String.h.

◆ Prepend() [4/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Prepend ( const_c_string  t,
size_type  n 
)
inline

Inserts a copy of the first n characters of a character array t at the beginning of this string.

Definition at line 1904 of file String.h.

◆ Prepend() [5/5]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Prepend ( const_iterator  i,
const_iterator  j 
)
inline

Inserts a copy of the character sequence defined by the range [i,j) at the beginning of this string.

If i is greater than or equal to j, calling this member function has no effect.

Definition at line 1895 of file String.h.

◆ Release()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
c_string pcl::GenericString< T, R, A >::Release ( )
inline

Releases the data in this string.

This member function returns a pointer to the string data block referenced by this object, after ensuring that it is uniquely referenced. If the string is empty, this function may return the null pointer.

Before returning, this member function empties this string without deallocating its string data. The caller is then responsible for destructing and/or deallocating the returned block when it is no longer required.

Definition at line 1630 of file String.h.

◆ Replace() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Replace ( size_type  i,
size_type  n,
char_type  c,
size_type  nc = 1 
)
inline

Replaces a segment of at most n contiguous characters, starting at the i-th character in this string, with nc copies of a character c.

Definition at line 2025 of file String.h.

◆ Replace() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
void pcl::GenericString< T, R, A >::Replace ( size_type  i,
size_type  n,
const GenericString< T, R1, A1 > &  s 
)
inline

Replaces a segment of n contiguous characters, starting at the i-th character in this string, with a copy of a string s.

Definition at line 1951 of file String.h.

◆ Replace() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Replace ( size_type  i,
size_type  n,
const_c_string  t 
)
inline

Replaces a segment of at most n contiguous characters, starting at the i-th character in this string, with a copy of a null-terminated sequence t.

If t is a pointer to the contents of this string (or, equivalently, an iterator on this string), this function invokes undefined behavior.

Definition at line 1990 of file String.h.

◆ ReplaceChar()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ReplaceChar ( char_type  c1,
char_type  c2,
size_type  i = 0,
size_type  n = maxPos 
)
inline

Replaces all occurrences of a character c1 with c2 in a segment of n contiguous characters starting at the i-th character in this string.

Definition at line 2060 of file String.h.

◆ ReplaceCharIC()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ReplaceCharIC ( char_type  c1,
char_type  c2,
size_type  i = 0,
size_type  n = maxPos 
)
inline

Replaces all occurrences of a character c1 with c2 in a segment of n contiguous characters starting at the i-th character in this string.

This member function performs case-insensitive character comparisons.

Definition at line 2072 of file String.h.

◆ ReplaceString() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 , class R2 , class A2 >
void pcl::GenericString< T, R, A >::ReplaceString ( const GenericString< T, R1, A1 > &  s1,
const GenericString< T, R2, A2 > &  s2,
size_type  i = 0 
)
inline

Replaces all occurrences of a string s1 with s2 in a segment of contiguous characters starting at the i-th character, and spanning to the end of this string.

Definition at line 2083 of file String.h.

◆ ReplaceString() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ReplaceString ( const_c_string  t1,
const_c_string  t2,
size_type  i = 0 
)
inline

Replaces all occurrences of a null-terminated string t1 with t2 in a segment of contiguous characters starting at the i-th character, and spanning to the end of this string.

Definition at line 2094 of file String.h.

◆ ReplaceStringIC() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 , class R2 , class A2 >
void pcl::GenericString< T, R, A >::ReplaceStringIC ( const GenericString< T, R1, A1 > &  s1,
const GenericString< T, R2, A2 > &  s2,
size_type  i = 0 
)
inline

Replaces all occurrences of a string s1 with s2 in a segment of contiguous characters starting at the i-th character, and spanning to the end of this string.

This member function performs case-insensitive string comparisons.

Definition at line 2107 of file String.h.

◆ ReplaceStringIC() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ReplaceStringIC ( const_c_string  t1,
const_c_string  t2,
size_type  i = 0 
)
inline

Replaces all occurrences of a null-terminated string t1 with t2 in a segment of contiguous characters starting at the i-th character, and spanning to the end of this string.

This member function performs case-insensitive string comparisons.

Definition at line 2120 of file String.h.

◆ Reserve()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Reserve ( size_type  n)
inline

Ensures that this string has enough capacity to store n characters plus a terminating null character.

After calling this member function with n > 0, this object is guaranteed to uniquely reference its string data.

Definition at line 1462 of file String.h.

◆ ResizedToNullTerminated()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::ResizedToNullTerminated ( ) const
inline

Returns a copy of this string resized to match the length of its internal null-terminated string buffer.

Definition at line 1560 of file String.h.

◆ ResizeToNullTerminated()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ResizeToNullTerminated ( )
inline

Resizes this string to match the length of the internal null-terminated string buffer.

This member function scans the internal string buffer for a terminating null character, then calls SetLength() to set the corresponding length in characters.

Definition at line 1551 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::ResizedToNullTerminated().

◆ Reverse()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Reverse ( )
inline

Transposes the characters in this string, so that the first character becomes the last and the last becomes the first, the second becomes the next-to-last, and so on.

Definition at line 4051 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Reversed().

◆ ReverseBegin() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
reverse_iterator pcl::GenericString< T, R, A >::ReverseBegin ( )
inline

Returns a reverse mutable iterator pointing to the reverse beginning of this string. The returned iterator points to the last character of this string.

If this string is not unique, it is made unique before returning from this member function.

If this string is empty, this member function returns a null reverse iterator.

See also
ReverseEnd()

Definition at line 1038 of file String.h.

◆ ReverseBegin() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_reverse_iterator pcl::GenericString< T, R, A >::ReverseBegin ( ) const
inlinenoexcept

Returns an immutable reverse iterator pointing to the reverse beginning of this string. The returned iterator points to the last character of this string.

If this string is empty, this member function returns a null reverse iterator.

See also
ReverseEnd() const

Definition at line 1054 of file String.h.

◆ Reversed()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Reversed ( ) const
inline

Returns a duplicate of this string with its characters in reverse order.

Definition at line 4064 of file String.h.

◆ ReverseEnd() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
reverse_iterator pcl::GenericString< T, R, A >::ReverseEnd ( )
inline

Returns a reverse mutable iterator pointing to the reverse end of this string. The returned iterator points to the previous-to-first character of this string.

If this string is not unique, it is made unique before returning from this member function.

If this string is empty, this member function returns a null reverse iterator.

See also
ReverseBegin()

Definition at line 1072 of file String.h.

◆ ReverseEnd() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const_reverse_iterator pcl::GenericString< T, R, A >::ReverseEnd ( ) const
inlinenoexcept

Returns an immutable reverse iterator pointing to the reverse end of this string. The returned iterator points to the previous-to-first character of this string.

If this string is empty, this member function returns a null reverse iterator.

See also
ReverseBegin() const

Definition at line 1088 of file String.h.

◆ Right()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Right ( size_type  n) const
inline

Returns a string with a copy of the at most n contiguous ending characters of this string.

Definition at line 2322 of file String.h.

◆ RightJustified()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::RightJustified ( size_type  width,
char_type  fill = R::Blank() 
) const
inline

Returns a duplicate of this string padded to the left, using the specified fill character, up to the specified width.

See also
JustifyRight(), LeftJustified(), CenterJustified()

Definition at line 3590 of file String.h.

◆ SecureFill()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::SecureFill ( char  c = '\0')
inlinenoexcept

Securely fills this string and all instances sharing its string data with the specified character c.

If no filling character c is specified, the string will be filled with zeros, or null characters.

The normal data sharing mechanism is ignored on purpose by this function, so if there are other objects sharing the same string data, all of them will be affected unconditionally after calling this function.

This function is useful to ensure that sensitive data, such as user passwords and user names, are destroyed without the risk of surviving duplicates as a result of implicit data sharing.

Note
If the specified filling character c is zero, or the null character (the default value), the internal string pointer will be seen as an empty string by C library routines (such as strlen or strcpy) and other applications after calling this function, although it will continue storing the same allocated data block.

Definition at line 1448 of file String.h.

Referenced by pcl::AES256::AES256().

◆ SetAllocator()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::SetAllocator ( const allocator a)
inline

Sets the allocator object used by this string to a copy of the specified allocator a.

If this string is not unique, it is made unique before returning from this member function.

See also
Allocator()

Definition at line 869 of file String.h.

◆ SetLength()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::SetLength ( size_type  n)
inline

Causes this string to have the specified length n in characters.

If n is zero, this function calls Clear() to empty the string. Otherwise the string data will be shrunk or extended, and possibly reallocated. If the resulting string is larger than the original, newly allocated or reserved characters won't be initialized and will have unpredictable values; in this case it is the caller's responsibility to write them as appropriate.

After calling this member function, this object is guaranteed to uniquely reference its string data.

Definition at line 1505 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::SetToLength(), and pcl::IsoString::ToString().

◆ SetToLength()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::SetToLength ( size_type  n) const
inline

Returns a copy of this string resized to have the specified length n in characters. This function is a wrapper for SetLength(); see that function for important information.

Definition at line 1535 of file String.h.

◆ SingleQuoted()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::SingleQuoted ( ) const
inline

Returns a duplicate of this string enclosed by single quote characters ('). If this string is already single quoted, this function returns an unmodified copy.

See also
EnsureSingleQuoted()

Definition at line 3436 of file String.h.

◆ Size()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::Size ( ) const
inlinenoexcept

Returns the total number of bytes required to store the string data referenced by this string, excluding the terminating null character.

See also
Length(), Capacity()

Definition at line 749 of file String.h.

◆ Sort() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Sort ( )
inline

Sorts the characters of this string in ascending order.

Definition at line 4074 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Sorted().

◆ Sort() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class BP >
void pcl::GenericString< T, R, A >::Sort ( BP  p)
inline

Sorts the characters of this string in ascending order. Ordering is defined such that for any pair a, b of characters, the specified binary predicate p( a, b ) is true if a precedes b.

Definition at line 4100 of file String.h.

◆ Sorted() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Sorted ( ) const
inline

Returns a duplicate of this string with its characters sorted in ascending order.

Definition at line 4087 of file String.h.

◆ Sorted() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class BP >
GenericString pcl::GenericString< T, R, A >::Sorted ( BP  p) const
inline

Returns a duplicate of this string with its characters sorted in ascending order with the specified binary predicate p.

Definition at line 4114 of file String.h.

◆ Squeeze()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Squeeze ( )
inline

Causes this string to allocate the exact required memory space to store its contained characters, plus a terminating null character.

If the string has excess capacity, a new copy of its existing characters is generated and stored in a newly allocated memory block that fits them exactly, then the previous memory block is deallocated.

If the string is empty, calling this function is equivalent to Clear(). Note that in this case a previously allocated memory block (by a call to Reserve()) may also be deallocated.

Definition at line 1579 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Squeezed().

◆ Squeezed()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Squeezed ( ) const
inline

Returns a copy of this string allocated to the exact required memory space to store its contained characters and a terminating null character.

Definition at line 1610 of file String.h.

◆ StartsWith() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::StartsWith ( char_type  c) const
inlinenoexcept

Returns true iff this string begins with the specified character c.

Definition at line 2856 of file String.h.

◆ StartsWith() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::StartsWith ( const GenericString< T, R1, A1 > &  s) const
inlinenoexcept

Returns true iff this string begins with the specified substring s.

Definition at line 2828 of file String.h.

Referenced by pcl::FITSHeaderKeyword::IsString().

◆ StartsWith() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::StartsWith ( const_c_string  t) const
inlinenoexcept

Returns true iff this string begins with the specified null-terminated sequence t.

Definition at line 2842 of file String.h.

◆ StartsWithIC() [1/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::StartsWithIC ( char_type  c) const
inlinenoexcept

Returns true iff this string begins with the specified character c, performing a case-insensitive character comparison.

Definition at line 2895 of file String.h.

◆ StartsWithIC() [2/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::StartsWithIC ( const GenericString< T, R1, A1 > &  s) const
inlinenoexcept

Returns true iff this string begins with the specified substring s, performing case-insensitive character comparisons.

Definition at line 2866 of file String.h.

◆ StartsWithIC() [3/3]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::StartsWithIC ( const_c_string  t) const
inlinenoexcept

Returns true iff this string begins with the specified null-terminated sequence t, performing case-insensitive character comparisons.

Definition at line 2880 of file String.h.

◆ Substring()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Substring ( size_type  i,
size_type  n = maxPos 
) const
inline

Returns a string with a copy of at most n contiguous characters starting at the i-th character in this string.

Definition at line 2275 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Assign().

◆ Suffix()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Suffix ( size_type  i) const
inline

Returns the suffix of this string starting at index i. Calling this member function is equivalent to:

Right( Length()-i )

Definition at line 2346 of file String.h.

◆ Swap()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Swap ( GenericString< T, R, A > &  s)
inlinenoexcept

Exchanges this string with another string s.

Definition at line 1366 of file String.h.

◆ ToCaseFolded()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ToCaseFolded ( )
inline

Replaces all characters in this string with their case folded counterparts.

Definition at line 3975 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::CaseFolded().

◆ ToLowercase()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ToLowercase ( )
inline

Replaces all uppercase characters in this string with their lowercase counterparts.

Definition at line 3989 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Lowercase().

◆ ToUppercase()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::ToUppercase ( )
inline

Replaces all lowercase characters in this string with their uppercase counterparts.

Definition at line 4003 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Uppercase().

◆ Transfer() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Transfer ( GenericString< T, R, A > &&  s)
inline

Transfers data from another object s to this string.

See Transfer( GenericString& ) for detailed information.

Definition at line 1224 of file String.h.

◆ Transfer() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Transfer ( GenericString< T, R, A > &  s)
inline

Transfers data from another object s to this string.

Decrements the reference counter of the current string data. If the data becomes unreferenced, it is destroyed and deallocated. The string data referenced by the source object s is then transferred to this object.

Warning
The source string s will be an invalid object after calling this function, and hence should be destroyed immediately. Any attempt to access an invalid object will most likely lead to a crash.
See also
Assign()

Definition at line 1212 of file String.h.

◆ Trim()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Trim ( )
inline

Removes all leading and trailing trimable characters.

Trimable characters are determined by the traits class R. A character c is trimable if R::IsTrimable( c ) is true. Generally, the set of trimable characters corresponds to the set of white space characters.

See also
Trimmed();

Definition at line 3286 of file String.h.

Referenced by pcl::FITSHeaderKeyword::Trim(), and pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Trimmed().

◆ TrimLeft()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::TrimLeft ( )
inline

Removes all leading trimable characters.

Trimable characters are determined by the traits class R. A character c is trimable if R::IsTrimable( c ) is true. Generally, the set of trimable characters corresponds to the set of white space characters.

See also
TrimmedLeft();

Definition at line 3303 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::TrimmedLeft().

◆ Trimmed()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Trimmed ( ) const
inline

Returns a duplicate of this string with all leading and trailing trimable characters removed.

See also
Trim()

Definition at line 3331 of file String.h.

◆ TrimmedLeft()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::TrimmedLeft ( ) const
inline

Returns a duplicate of this string with all leading trimable characters removed.

See also
TrimLeft()

Definition at line 3343 of file String.h.

◆ TrimmedRight()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::TrimmedRight ( ) const
inline

Returns a duplicate of this string with all trailing trimable characters removed.

See also
TrimRight()

Definition at line 3355 of file String.h.

◆ TrimRight()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::TrimRight ( )
inline

Removes all trailing trimable characters.

Trimable characters are determined by the traits class R. A character c is trimable if R::IsTrimable( c ) is true. Generally, the set of trimable characters corresponds to the set of white space characters.

See also
TrimmedRight();

Definition at line 3319 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::TrimmedRight().

◆ Unquote()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
void pcl::GenericString< T, R, A >::Unquote ( )
inline

Unquotes this string.

If the string starts and ends with single quote characters, the result is the same string with the quotes removed and its length decremented by two. The same happens if the string starts and ends with double quote characters.

If the string does not start and end with the same quote character, this function has no effect.

See also
Unquoted()

Definition at line 3480 of file String.h.

Referenced by pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Unquoted().

◆ Unquoted()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Unquoted ( ) const
inline

Returns an unquoted duplicate of this string.

See also
Unquote()

Definition at line 3504 of file String.h.

◆ UpperBound()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
size_type pcl::GenericString< T, R, A >::UpperBound ( ) const
inlinenoexcept

Returns the maximum valid character index.

The returned value is equal to Length()-1. If this string is empty, the index returned by this member function is invalid and equal to maxPos.

See also
LowerBound(), Length()

Definition at line 844 of file String.h.

◆ Uppercase()

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
GenericString pcl::GenericString< T, R, A >::Uppercase ( ) const
inline

Returns a duplicate of this string with all lowercase characters replaced with their uppercase counterparts.

Definition at line 4039 of file String.h.

◆ WildMatch() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::WildMatch ( const GenericString< T, R1, A1 > &  pattern,
bool  caseSensitive = true 
) const
inlinenoexcept

Wildcard string matching.

Parameters
patternThe pattern string. May contain multiple instances of the wildcard characters '*' and '?'.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters. The default value is true.

Returns true iff this string matches the specified pattern. If either this string or the pattern is empty, this function always returns false conventionally, even if the pattern is a single asterisk '*'.

Definition at line 3896 of file String.h.

◆ WildMatch() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::WildMatch ( const_c_string  pattern,
bool  caseSensitive = true 
) const
inlinenoexcept

Wildcard string matching with a null-terminated pattern.

Parameters
patternThe pattern string. May contain multiple instances of the wildcard characters '*' and '?'.
caseSensitiveWhen true, a case-sensitive comparison is performed; otherwise the comparison does not distinguish between lowercase and uppercase characters. The default value is true.

Returns true iff this string matches the specified pattern. If either this string or the pattern is empty, this function always returns false conventionally, even if the pattern is a single asterisk '*'.

Definition at line 3935 of file String.h.

◆ WildMatchIC() [1/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
template<class R1 , class A1 >
bool pcl::GenericString< T, R, A >::WildMatchIC ( const GenericString< T, R1, A1 > &  pattern) const
inlinenoexcept

Wildcard string matching (case-insensitive).

Parameters
patternThe pattern string. May contain multiple instances of the wildcard characters '*' and '?'.

This function performs case-insensitive comparisons between string and non-wild pattern characters.

Returns true iff this string matches the specified pattern. If either this string or the pattern is empty, this function always returns false conventionally, even if the pattern is a single asterisk '*'.

Definition at line 3915 of file String.h.

◆ WildMatchIC() [2/2]

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
bool pcl::GenericString< T, R, A >::WildMatchIC ( const_c_string  pattern) const
inlinenoexcept

Wildcard string matching with a null-terminated pattern (case-insensitive).

Parameters
patternThe pattern string. May contain multiple instances of the wildcard characters '*' and '?'.

This function performs case-insensitive comparisons between string and non-wild pattern characters.

Returns true iff this string matches the specified pattern. If either this string or the pattern is empty, this function always returns false conventionally, even if the pattern is a single asterisk '*'.

Definition at line 3954 of file String.h.

Member Data Documentation

◆ maxPos

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const size_type pcl::GenericString< T, R, A >::maxPos = ~size_type( 0 )
static

Corresponds to the maximum possible character index in a string.

Definition at line 556 of file String.h.

◆ notFound

template<class T , class R , class A = PCL_STRING_ALLOCATOR>
const size_type pcl::GenericString< T, R, A >::notFound = ~size_type( 0 )
static

Constant used to signal unsuccessful search operations.

Definition at line 551 of file String.h.


The documentation for this class was generated from the following file:
pcl::GenericString::Assign
void Assign(const GenericString &s)
Definition: String.h:1181
pcl::GenericString::GenericString
GenericString()
Definition: String.h:563
pcl::GenericString::Left
GenericString Left(size_type n) const
Definition: String.h:2300
pcl::GenericString::Right
GenericString Right(size_type n) const
Definition: String.h:2322
pcl::GenericString::Length
size_type Length() const noexcept
Definition: String.h:760