ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
cstring.hpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header file is part of module \alib_strings of the \aliblong.
4///
5/// \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6/// Published under \ref mainpage_license "Boost Software License".
7//==================================================================================================
8#ifndef HPP_ALIB_STRINGS_CSTRING
9#define HPP_ALIB_STRINGS_CSTRING 1
10#pragma once
12
13// conditional expression is constant for using our constant template parameters to select
14// checking vs. non-checking method versions
15#if defined(_MSC_VER)
16 #pragma warning( push )
17 #pragma warning( disable : 4127 )
18#endif
19
20namespace alib { namespace strings {
21
22//==================================================================================================
23/// This class specializes its base class \alib{strings;TString;String} in that respect that
24/// the character strings represented are guaranteed to be zero-terminated.<br>
25/// Zero-terminated strings are widely used by programming language \b C and are often called
26/// "C-strings", what gave the class its name.
27///
28/// \see
29/// For an introduction into the \alib string classes see this module's
30/// \ref alib_mod_strings "Programmer's Manual".
31///
32/// @tparam TChar The \ref alib_characters_chars "character type" of this string.
33//==================================================================================================
34template<typename TChar>
35class TCString : public TString<TChar>
36{
37protected:
38 /// Shortcut to the base type.
40
41public:
42
43 //==============================================================================================
44 /// Default constructor creating a \ref alib_strings_details_nulled \e "nulled" c-string.
45 //==============================================================================================
46 constexpr
48 : base()
49 {}
50
51 //==============================================================================================
52 /// Constructor accepting a pointer to a character array and a string length.
53 ///
54 /// \note
55 /// It is a user's responsibility to ensure that the character array provided includes
56 /// a terminating \c '\0' character.<br>
57 /// In debug-compilations a run-time assertion is raised if the provided buffer is not
58 /// zero-terminated.
59 ///
60 ///
61 /// @param pBuffer The buffer to use.
62 /// @param contentLength The length of the content in the given buffer.
63 //==============================================================================================
64 constexpr
65 explicit
66 TCString( const TChar* pBuffer, integer contentLength )
67 : base( pBuffer, contentLength )
68 {
69 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
72 || base::buffer[base::length] == '\0', "STRINGS",
73 "Error: Explicit construction of CString with unterminated string." )
75 #endif
76 }
77
78
79 #if DOXYGEN
80 //==========================================================================================
81 /// This templated constructor accepts various different kinds of source data.
82 /// Unlike this documentation suggests, this constructor is internally implemented by a
83 /// series of different constructors which are selected using template meta programming
84 /// (i.e., \c std::enable_if).
85 ///
86 /// Together, the set of constructors provide maximum flexibility by allowing implicit
87 /// construction with (and assignment of) any built-in or third-party character array type.
88 /// Some of the constructors are defined using keyword \c explict.
89 ///
90 /// In debug-compilations a run-time assertion is raised if the provided buffer is not
91 /// zero-terminated.
92 ///
93 /// \see
94 /// More information about construction of this type is provided with chapter
95 /// \ref alib_strings_cc_construction_cstring of the Programmer's Manual of module
96 /// \alib_strings.
97 ///
98 /// @tparam TZTCharArray Type that comprises a zero-terminated character array.
99 /// @param src The source object.
100 //==========================================================================================
101 template <typename TZTCharArray>
102 inline
103 constexpr
104 TCString( const TTerminatable& src );
105
106
107 //==========================================================================================
108 /// \b Implicit cast operator to objects of type \p{TZTCharArray}.<br>
109 /// This operator is available for all custom types that have an accordingly specialized
110 /// version of TMP struct \alib{characters;T_CharArray} and/or
111 /// \alib{characters;T_ZTCharArray} defined.
112 ///
113 /// \see
114 /// More information about casting \alib string-types to built-in C++ types or custom
115 /// types is provided with chapter \ref alib_strings_cc_cast_cstring of the Programmer's
116 /// Manual of module \alib_strings.
117 ///
118 /// @tparam TZTCharArray The custom type to implicitly convert this object to.
119 /// @return A value of custom string-type.
120 //==========================================================================================
121 template<typename TZTCharArray>
122 inline
123 operator TZTCharArray () const
124 {}
125
126 //==========================================================================================
127 /// \b Explicit cast operator to objects of type \p{TZTCharArray}.<br>
128 /// This operator is available for all custom types that have an accordingly specialized
129 /// version of TMP struct \alib{characters;T_CharArray} and/or
130 /// \alib{characters;T_ZTCharArray} defined.
131 ///
132 /// \see
133 /// More information about casting \alib string-types to built-in C++ types or custom
134 /// types is provided with chapter \ref alib_strings_cc_cast_cstring of the Programmer's
135 /// Manual of module \alib_strings.
136 ///
137 /// @tparam TZTCharArray The custom type to explicitly convert this object to.
138 /// @return A value of custom string-type.
139 //==========================================================================================
140 template<typename TZTCharArray>
141 inline explicit
142 operator TZTCharArray () const
143 {}
144
145 #else // no doxygen now
146
147 // ##################### Constructors selected with std::enable_if #########################
149
150 ATMP_SELECT_IF_1TP( typename T, std::is_same<std::nullptr_t,T>::value )
151 constexpr
152 TCString(const T& )
153 : base( nullptr, 0 )
154 {}
155
156 template <typename T,
157 typename std::enable_if< characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Access
158 == characters::AccessType::Implicit, int>::type = 0 >
159 constexpr
160 TCString(const T& src)
161 : base( characters::T_ZTCharArray<ATMP_RCV(T), TChar>::Buffer( src ),
162 characters::T_ZTCharArray<ATMP_RCV(T), TChar>::Length( src ) )
163 {
164 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
166 || base::buffer[base::length] == '\0', "STRINGS",
167 "Error: Implicit construction of CString with unterminated string." )
168 #endif
169 }
170
171 ATMP_SELECT_IF_1TP( typename T, characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Access
173 constexpr
174 TCString(const T* src)
175 : base( characters::T_ZTCharArray<ATMP_RCV(T), TChar>::Buffer( *src ),
176 characters::T_ZTCharArray<ATMP_RCV(T), TChar>::Length( *src ) )
177 {
178 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
180 || base::buffer[base::length] == '\0', "STRINGS",
181 "Error: Implicit construction of CString with unterminated string." )
182 #endif
183 }
184
185 ATMP_SELECT_IF_1TP( typename T, characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Access
187 constexpr
188 explicit
189 TCString( T& src)
190 : base( characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Buffer( src ),
191 characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Length( src ) )
192 {
193 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
195 || base::buffer[base::length] == '\0', "STRINGS",
196 "Error: Explicit construction of CString with unterminated string." )
197 #endif
198 }
199
200 ATMP_SELECT_IF_1TP( typename T, characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Access
202 constexpr
203 explicit
204 TCString( T* src)
205 : base( characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Buffer( *src ),
206 characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Length( *src ) )
207 {
208 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
210 || base::buffer[base::length] == '\0', "STRINGS",
211 "Error: Explicit construction of CString with unterminated string." )
212 #endif
213 }
214
215 ATMP_SELECT_IF_1TP( typename T, characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Access
216 == characters::AccessType::MutableOnly && !std::is_const<T>::value )
217 constexpr
218 explicit
219 TCString( T& src)
220 : base( characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Buffer( const_cast<T&>( src ) ),
221 characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Length( const_cast<T&>( src ) ) )
222 {
223 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
225 || base::buffer[base::length] == '\0', "STRINGS",
226 "Error: Construction of CString (from mutable object) with unterminated string." )
227 #endif
228 }
229
230 ATMP_SELECT_IF_1TP( typename T, characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Access
231 == characters::AccessType::MutableOnly && !std::is_const<T>::value )
232 constexpr
233 explicit
234 TCString( T* src)
235 : base( characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Buffer( *src ),
236 characters::T_ZTCharArray<ATMP_RCV(T),TChar>::Length( *src ) )
237 {
238 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
240 || base::buffer[base::length] == '\0', "STRINGS",
241 "Error: Construction of CString (from mutable object) with unterminated string." )
242 #endif
243 }
244
245 // ############################## casting back ######################################
248 && !T_SuppressAutoCast<TCString<TChar>,characters::ConstructionType::Implicit ,ATMP_RCV(T)>::value)
249 operator T () const
250 {
252 }
253
257 explicit
258 operator T () const
259 {
261 }
262
263
266 && characters::T_ZTCharArray<T,TChar>::Construction
268 && !T_SuppressAutoCast<TCString<TChar>,characters::ConstructionType::Implicit ,ATMP_RCV(T)>::value)
269 operator T () const
270 {
272 }
273
276 && characters::T_ZTCharArray<T,TChar>::Construction
279 explicit
280 operator T () const
281 {
283 }
284
286 #endif // doxygen
287
288 //==============================================================================================
289 /// Allocates memory including a termination character, copies the given string's contents
290 /// and zero-terminates this string.
291 ///
292 /// \see
293 /// Methods #Allocate and #Free for information how to use allocated string objects.
294 ///
295 /// @tparam TAllocator The type of the given \p{allocator}, as prototyped with
296 /// \alib{lang;Allocator}. Deduced by the compiler.
297 /// @param allocator The allocator to use.
298 /// @param copy The string to copy to the new memory allocated.
299 //==============================================================================================
300 template<typename TAllocator, typename TEnableIf= typename TAllocator::ChainedAllocator>
301 TCString( TAllocator& allocator, const TString<TChar>& copy )
302 {
303 if( (base::length= copy.Length()) == 0 )
304 {
305 base::buffer= copy.Buffer();
306 return;
307 }
308
309 auto* newBuf= allocator().template AllocArray<TChar>( copy.Length() + 1);
310 copy.CopyTo( newBuf );
312 newBuf[base::length]= '\0';
314 base::buffer= newBuf;
315 }
316
317 //==============================================================================================
318 /// Reads a character at a given index.<br> Overrides
319 /// \alib{strings;TString::operator[];String::operator[]} to change the debug assertion
320 /// to allow inclusion of the termination character.
321 ///
322 /// \attention
323 /// No parameter check is performed (other than an assertions in debug-compilation of
324 /// \alib). See \alib{strings;TString::operator[];String::operator[]} for details.
325 ///
326 /// @param op The index of the character within this object's buffer.
327 /// @returns If the character contained at index \p{op}.
328 //==============================================================================================
329 TChar operator[] (integer op) const
330 {
331 ALIB_ASSERT_ERROR( op >= 0 && op <= base::length, "STRINGS",
332 "Index out of bounds" )
334 return base::buffer[op];
336 }
337
338 //==============================================================================================
339 /// Returns the index of the first character which is included, respectively <em>not</em>
340 /// included in a given set of characters.
341 ///
342 /// This method searches forwards. For backwards search, see
343 /// \alib{strings;TString::LastIndexOfAny;String::LastIndexOfAny}.
344 ///
345 /// \note
346 /// This method overrides method \alib{strings;TString::IndexOfAny;String::IndexOf}.
347 /// This implementation however expects a \b %CString with parameter \p{needles}
348 /// (beside the fact that it has to be invoked on a \b %CString itself).
349 /// If no zero-terminated needle string is available, the parent's original method
350 /// needs to be invoked. This has to be done by explicitly naming
351 /// the parent class in the invocation, like for example in
352 ///
353 /// myCString.TString::IndexOfAny<Inclusion::Include>( myString );
354 ///
355 /// \note
356 /// On most platforms, this zero-terminated version should perform slightly faster than
357 /// the original method in class \b %String.
358 ///
359 /// @tparam TCheck Defaults to \alib{CHK}, which is the normal invocation mode.
360 /// If \c <false> is added to the method name, no parameter checks are
361 /// performed and the needles must not be empty.
362 /// @tparam TInclusion Denotes whether the search returns the first index that holds a value
363 /// that is included or that is not excluded in the set of needle
364 /// characters.
365 /// @param needles Set of characters to be taken into account.
366 /// @param startIdx The index to start the search at. If the given value is less than \c 0,
367 /// it is set to \c 0. If it exceeds the length of the string, the length of
368 /// the string is returned.
369 /// Defaults to \c 0.
370 ///
371 /// @return The index of the first character found which is included, respectively not
372 /// included, in the given set of characters. If nothing is found, \c -1 is returned.
373 //==============================================================================================
374 template <lang::Inclusion TInclusion,
375 typename TCheck= CHK >
376 integer IndexOfAny( const TCString& needles, integer startIdx= 0 )
377 const
378 {
379 if (TCheck::value)
380 {
381 if ( startIdx < 0 ) startIdx= 0;
382 if ( startIdx >= base::length ) return -1;
383 }
384 else
385 {
386 ALIB_ASSERT_ERROR( startIdx >= 0
387 && startIdx < base::length
388 && needles.Length() != 0, "STRINGS",
389 "Non checking and illegal parameters" )
390 }
391
392
394 if constexpr ( TInclusion == lang::Inclusion::Include )
395 {
397 return idx >= 0 ? idx + startIdx : -1;
398 }
399 else
400 {
401 const TChar* haystack= base::buffer + startIdx;
402 integer idx= characters::IndexOfAnyExcludedZT<TChar>( haystack, needles );
403 return idx < 0 || *( haystack + idx ) == '\0' ? -1 : startIdx + idx;
404 }
406 }
407
408 //==============================================================================================
409 /// Sets this object to a zero-terminated copy of the given string, allocated in
410 /// given \p{allocator}.
411 ///
412 /// \note
413 /// In case given \p{copy} is empty or nulled, no allocation is performed and this string
414 /// is set to empty. Still the pointer to the buffer is copied. Thus, this string
415 /// behaves in respect to method #IsNull the same as given string \p{copy}.
416 ///
417 /// @tparam TAllocator The type of the given \p{allocator}, as prototyped with
418 /// \alib{lang;Allocator}. Deduced by the compiler.
419 /// @param allocator The allocator to use.
420 /// @param copy The string to copy to the new memory allocated.
421 //==============================================================================================
422 template<typename TAllocator>
423 void Allocate( TAllocator& allocator, const TString<TChar>& copy )
424 {
425 if( (base::length= copy.Length()) == 0 )
426 {
427 base::buffer= copy.Buffer();
428 return;
429 }
430
431 auto* newBuf= allocator().template AllocArray<TChar>( base::length + 1);
432 copy.CopyTo( newBuf );
433 newBuf[base::length]= '\0';
434 base::buffer= newBuf;
435 }
436
437 /// Deallocates this String's memory in \p{allocator} and sets this instance to \e nulled.
438 /// \note
439 /// In case this instance is empty or nulled, no de-allocation is performed.
440 /// This should not happen with due usage. Due usage is:
441 /// - A string is allocated using method #Allocate on another instance.
442 /// - For the allocated string, this method is to be called, passing the same allocator.
443 ///
444 /// \note
445 /// Nevertheless, because of the fact that method #Allocate likewise does not allocate
446 /// in case an empty string was given, it is still good use to allocate and deallocate
447 /// empty strings.
448 /// @tparam TAllocator The type of the given \p{allocator}, as prototyped with
449 /// \alib{lang;Allocator}. Deduced by the compiler.
450 /// @param allocator The allocator to use.
451 template<typename TAllocator>
452 void Free( TAllocator& allocator ) const
453 {
454 if( base::length == 0 || base::buffer == nullptr )
455 return;
456 allocator().FreeArray( base::buffer, base::length + 1 );
457 }
458
459}; // class TCString
460
461
462//==================================================================================================
463/// This template class has three specializations for types \alib{characters;nchar},
464/// \alib{characters;wchar}, and \alib{characters;xchar}, which each provide the following
465/// static \c constexpr methods:
466/// - #EmptyString,
467/// - #NewLine, and
468/// - #DefaultWhitespaces.
469///
470/// The class is useful to implement methods that are templated with the character type they use.
471///
472/// \note
473/// In non-templated code (that works with fixed or logical character sizes), it might lead to
474/// better readability if the following shortcut/alias functions of namespace #alib are used:
475/// - \ref EMPTY_CSTRING, \ref EMPTY_COMPLEMENT_CSTRING, \ref EMPTY_STRANGE_CSTRING,
476/// \ref EMPTY_NCSTRING, \ref EMPTY_WCSTRING, \ref EMPTY_XCSTRING,
477/// - \ref NEW_LINE, \ref COMPLEMENT_NEW_LINE, \ref STRANGE_NEW_LINE,
478/// \ref NNEW_LINE, \ref WNEW_LINE, \ref XNEW_LINE and
479/// - \ref DEFAULT_WHITESPACES, \ref COMPLEMENT_DEFAULT_WHITESPACES,
480/// \ref STRANGE_DEFAULT_WHITESPACES, \ref NDEFAULT_WHITESPACES, \ref WDEFAULT_WHITESPACES,
481/// \ref XDEFAULT_WHITESPACES.
482/// <p>
483///
484/// \note
485/// Constants for \e nulled strings are given with
486/// \ref NULL_STRING, \ref NULL_COMPLEMENT_STRING, \ref NULL_STRANGE_STRING,
487/// \ref NULL_NSTRING, \ref NULL_WSTRING and \ref NULL_XSTRING. However, those are returning
488/// type \b String instead of \b CString. For \e nulled objects of type \b CString use the
489/// keyword \c nullptr which performs implicit constexpr creation.
490///
491/// \see
492/// See also manual chapter \ref alib_strings_details_constants.
493///
494/// @tparam TChar The \ref alib_characters_chars "character type".
495//==================================================================================================
496template<typename TChar> struct TT_CStringConstants
497{
498 #if DOXYGEN
499 /// @return A \e zero-terminated empty string.
500 constexpr inline static CString<TChar> EmptyString();
501
502 /// On Windows OS, the returned string contains characters <c>'\\r'</c> and <c>'\\n'</c>, on
503 /// other platforms just character <c>'\\n'</c>.
504 /// @return A \e zero-terminated string containing platform-dependent "newline" charcater(s).
505 constexpr inline static CString<TChar> NewLine;
506
507 /// @return A zero-terminated string containing default whitespace characters "space", "newline"
508 /// "carriage return" and "tabulator", hence <c>" \n\r\t"</c>.
509 constexpr inline static CString<TChar> DefaultWhitespaces());
510 #endif
511};
512
513
514#if !DOXYGEN
515
516template<> struct TT_CStringConstants<nchar>
517{
518 constexpr static NCString EmptyString() { return "" ; }
519
520 #if defined(_WIN32)
521 constexpr static NCString NewLine() { return "\r\n" ; }
522 #else
523 constexpr static NCString NewLine() { return "\n" ; }
524 #endif
525
526 constexpr static NCString DefaultWhitespaces() { return " \n\r\t" ; }
527};
528
529template<> struct TT_CStringConstants<wchar>
530{
531 constexpr static WCString EmptyString() { return A_WCHAR("" ); }
532
533 #if defined(_WIN32)
534 constexpr static WCString NewLine() { return A_WCHAR("\r\n" ); }
535 #else
536 constexpr static WCString NewLine() { return A_WCHAR("\n" ); }
537 #endif
538
539 constexpr static WCString DefaultWhitespaces() { return A_WCHAR(" \n\r\t"); }
540};
541
542template<> struct TT_CStringConstants<xchar>
543{
544 constexpr static XCString EmptyString() { return A_XCHAR("" ); }
545
546 #if defined(_WIN32)
547 constexpr static XCString NewLine() { return A_XCHAR("\r\n" ); }
548 #else
549 constexpr static XCString NewLine() { return A_XCHAR("\n" ); }
550 #endif
551
552 constexpr static XCString DefaultWhitespaces() { return A_XCHAR(" \n\r\t"); }
553};
554
555#endif //!DOXYGEN
556
557} // namespace alib[::strings]
558
559/// A zero-terminated, empty string.
561
562/// A zero-terminated, empty string.
564
565/// A zero-terminated, empty string.
567
568/// A zero-terminated, empty string.
570
571/// A zero-terminated, empty string.
573
574/// A zero-terminated, empty string.
576
577
578
579/// A zero-terminated string containing the new-line character sequence.
581
582/// A zero-terminated string containing the new-line character sequence.
584
585/// A zero-terminated string containing the new-line character sequence.
587
588/// A zero-terminated string containing the new-line character sequence.
590
591/// A zero-terminated string containing the new-line character sequence.
593
594/// A zero-terminated string containing the new-line character sequence.
596
597
598
599/// A zero-terminated string of default whitespace characters.
601
602/// A zero-terminated string of default whitespace characters.
604
605/// A zero-terminated string of default whitespace characters.
607
608/// A zero-terminated string of default whitespace characters.
610
611/// A zero-terminated string of default whitespace characters.
613
614/// A zero-terminated string of default whitespace characters.
616
617
618} // namespace [alib]
619
620#if defined(_MSC_VER)
621 #pragma warning( pop )
622#endif
623#endif // HPP_ALIB_STRINGS_CSTRING
624
integer IndexOfAny(const TCString &needles, integer startIdx=0) const
Definition cstring.hpp:376
constexpr TCString()
Default constructor creating a 6.1 Nulled Strings "nulled" c-string.
Definition cstring.hpp:47
void Allocate(TAllocator &allocator, const TString< TChar > &copy)
Definition cstring.hpp:423
TCString(TAllocator &allocator, const TString< TChar > &copy)
Definition cstring.hpp:301
void Free(TAllocator &allocator) const
Definition cstring.hpp:452
constexpr TCString(const TChar *pBuffer, integer contentLength)
Definition cstring.hpp:66
TChar operator[](integer op) const
Definition cstring.hpp:329
TString< TChar > base
Shortcut to the base type.
Definition cstring.hpp:39
constexpr TCString(const TTerminatable &src)
constexpr bool IsNull() const
Definition string.hpp:364
const TChar * buffer
Definition string.hpp:117
constexpr integer Length() const
Definition string.hpp:326
integer CopyTo(TChar *dest) const
Definition string.hpp:1992
constexpr const TChar * Buffer() const
Definition string.hpp:319
#define ATMP_RCV( T)
Definition tmp.hpp:35
#define ALIB_WARNINGS_RESTORE
Definition alib.hpp:849
#define A_XCHAR(STR)
#define ALIB_ASSERT_ERROR(cond,...)
Definition alib.hpp:1271
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
Definition alib.hpp:760
#define A_WCHAR(STR)
#define ATMP_SELECT_IF_1TP(TParam, ...)
Definition tmp.hpp:58
integer IndexOfAnyIncludedZT(const TChar *haystack, const TChar *needles)
integer IndexOfAnyExcludedZT(const TChar *haystack, const TChar *needles)
@ ExplicitOnly
Allows explicit construction of objects from character array data.
@ Implicit
Allows implicit (and explicit) construction of objects from character array data.
@ ExplicitOnly
Allows explicit access of the character array data from mutable or constant objects.
@ MutableOnly
Allows explicit access of the character array data from mutable objects.
Inclusion
Denotes how members of a set something should be taken into account.
@ Include
Chooses inclusion.
Definition alib.cpp:69
constexpr WCString WDEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.hpp:612
constexpr StrangeCString STRANGE_DEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.hpp:606
constexpr CString DEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.hpp:600
constexpr NCString EMPTY_NCSTRING
A zero-terminated, empty string.
Definition cstring.hpp:569
characters::wchar wchar
Type alias in namespace alib.
constexpr NCString NNEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.hpp:589
constexpr NCString NDEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.hpp:609
constexpr XCString EMPTY_XCSTRING
A zero-terminated, empty string.
Definition cstring.hpp:575
constexpr WCString EMPTY_WCSTRING
A zero-terminated, empty string.
Definition cstring.hpp:572
constexpr WCString WNEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.hpp:592
characters::xchar xchar
Type alias in namespace alib.
constexpr ComplementCString COMPLEMENT_NEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.hpp:583
constexpr ComplementCString COMPLEMENT_DEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.hpp:603
constexpr ComplementCString EMPTY_COMPLEMENT_CSTRING
A zero-terminated, empty string.
Definition cstring.hpp:563
constexpr StrangeCString EMPTY_STRANGE_CSTRING
A zero-terminated, empty string.
Definition cstring.hpp:566
constexpr CString EMPTY_CSTRING
A zero-terminated, empty string.
Definition cstring.hpp:560
constexpr CString NEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.hpp:580
strings::TCString< nchar > NCString
Type alias in namespace alib.
characters::nchar nchar
Type alias in namespace alib.
constexpr XCString XDEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.hpp:615
constexpr StrangeCString STRANGE_NEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.hpp:586
strings::TCString< xchar > XCString
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Definition integers.hpp:273
strings::TCString< wchar > WCString
Type alias in namespace alib.
constexpr XCString XNEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.hpp:595
See sibling type NC.
Definition alib.hpp:1097
static constexpr ConstructionType Construction
static TString Construct(const TChar *array, integer length)
static TString Construct(const TChar *array, integer length)
static constexpr CString< TChar > NewLine
Definition cstring.hpp:505
static constexpr CString< TChar > DefaultWhitespaces())
"carriage return" and "tabulator", hence " \n\r\t".
static constexpr CString< TChar > EmptyString()