ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
cstring.inl
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-2025 A-Worx GmbH, Germany.
6/// Published under #"mainpage_license".
7//==================================================================================================
9
10template<typename TChar> class TCString;
11
13
14
16
17//==================================================================================================
18/// This class specializes its base class #"TString;String" in that respect that
19/// the character strings represented are guaranteed to be zero-terminated.<br>
20/// Zero-terminated strings are widely used by programming language \b C and are often called
21/// "C-strings", what gave the class its name.
22///
23/// \see
24/// For an introduction into the \alib string classes see this module's
25/// #"alib_mod_strings;Programmer's Manual".
26///
27/// @tparam TChar The #"alib_characters_chars;character type" of this string.
28//==================================================================================================
29template<typename TChar>
30class TCString : public TString<TChar>
31{
32 protected:
33 /// Shortcut to the base type.
35
36 public:
37 /// Defaulted default constructor. Leaves this instance \b uninitialized and undefined.
38 constexpr TCString() =default;
39
40 /// Constructor accepting a pointer to a character array and a string length.
41 /// \note
42 /// It is a user's responsibility to ensure that the character array provided includes
43 /// a terminating \c '\0' character.<br>
44 /// In debug-compilations a run-time assertion is raised if the provided buffer is not
45 /// zero-terminated.
46 /// @param pBuffer The buffer to use.
47 /// @param contentLength The length of the content in the given buffer.
48 constexpr
49 explicit
50 TCString( const TChar* pBuffer, integer contentLength )
51 : base( pBuffer, contentLength ) {
52 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
54 || base::buffer[base::length] == '\0', "STRINGS",
55 "Error: Explicit construction of CString with unterminated string." )
56 #endif
57 }
58
59
60 /// Constructor accepting \c nullptr. Constructs a nulled string.
61 constexpr TCString(lang::IsNullptr auto const &) noexcept : base( nullptr, 0 ) {}
62
63// Doxygen (V1.15) would create identical entries in its tag-file, so those are not reachable.
64// On the other hand, it complains if the methods are not doxed. So, we hide them from doxygen.
65#if DOXYGEN
66 /// Templated \b implicit constructor accepting a \c const reference to an object of a
67 /// type that satisfies the concepts
68 /// #"IsImplicitZTArraySource",
69 /// #"IsExplicitZTArraySource",
70 /// #"IsExplicitZTArraySource",
71 /// #"IsMutableZTArraySource", and
72 /// #"IsMutableZTArraySource".
73 ///
74 /// (Internally, for each concept an own constructor implementation is provided.)
75 /// Custom types can be enabled for this constructor by specializing the corresponding
76 /// traits-types.
77 ///
78 /// @tparam T The type of the given \p{src}.
79 /// Deduced by the compiler.
80 /// @param src The source of the string data to copy.
81 template <typename T>
82 constexpr TCString(T src);
83#else
84 template <typename T>
86 constexpr TCString(const T& src)
87 : base( characters::ZTArrayTraits<std::remove_cv_t<T>, TChar>::Buffer( src ),
88 characters::ZTArrayTraits<std::remove_cv_t<T>, TChar>::Length( src ) ) {
89 #if ALIB_DEBUG && !ALIB_DEBUG_ASSERTION_PRINTABLES
91 || base::buffer[base::length] == '\0', "STRINGS",
92 "Error: Implicit construction of CString with unterminated string." )
93 #endif
94 }
95
96 template <typename T>
98 constexpr TCString(const T* src)
99 : base( characters::ZTArrayTraits<std::remove_cv_t<T>, TChar>::Buffer( *src ),
100 characters::ZTArrayTraits<std::remove_cv_t<T>, TChar>::Length( *src ) ) {
102 || base::buffer[base::length] == '\0', "STRINGS",
103 "Error: Implicit construction of CString with unterminated string." )
104 }
105
106 template <typename T>
108 constexpr explicit TCString(T& src)
109 : base( characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Buffer( src ),
110 characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Length( src ) ) {
111 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
113 || base::buffer[base::length] == '\0', "STRINGS",
114 "Error: Explicit construction of CString with unterminated string." )
115 #endif
116 }
117
118 template <typename T>
120 constexpr explicit TCString(T* src)
121 : base( characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Buffer( *src ),
122 characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Length( *src ) ) {
123 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
125 || base::buffer[base::length] == '\0', "STRINGS",
126 "Error: Explicit construction of CString with unterminated string." )
127 #endif
128 }
129
130 template <typename T>
131 requires alib::characters::IsMutableZTArraySource<T, TChar>
132 constexpr explicit TCString(T& src)
133 : base( characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Buffer(const_cast<T&>( src )),
134 characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Length(const_cast<T&>( src )) ) {
135 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
137 || base::buffer[base::length] == '\0', "STRINGS",
138 "Error: Construction of CString (from mutable object) with unterminated string." )
139 #endif
140 }
141
142 template <typename T>
143 requires alib::characters::IsMutableZTArraySource<T, TChar>
144 constexpr explicit TCString(T* src)
145 : base( characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Buffer( *src ),
146 characters::ZTArrayTraits<std::remove_cv_t<T>,TChar>::Length( *src ) ) {
147 #if ALIB_DEBUG // needed to avoid empty {} in constexpr constructor
149 || base::buffer[base::length] == '\0', "STRINGS",
150 "Error: Construction of CString (from mutable object) with unterminated string." )
151 #endif
152 }
153#endif
154
155 /// Constructor, which allocates memory including an extra character for zero-termination,
156 /// copies the given string's contents and lets this \b %CString represent this new
157 /// zero-terminated character array.<br>
158 /// Note that it is up to the using code to duly deallocate the memory, because the
159 /// destructor of this type does not do so.
160 ///
161 /// \see
162 /// Methods #".Allocate" and #".Free" for information how to use allocated string objects.
163 ///
164 /// @tparam TAllocator The type of the given \p{allocator}, as prototyped with the class
165 /// #"lang::Allocator". Deduced by the compiler.
166 /// @param allocator The allocator to use.
167 /// @param copy The string to copy to the new memory allocated.
168 template<typename TAllocator>
169 requires alib::lang::IsAllocator<TAllocator>
170 TCString( TAllocator& allocator, const TString<TChar>& copy ) {
171 if( (base::length= copy.Length()) == 0 ) {
172 base::buffer= copy.Buffer();
173 return;
174 }
175
176 auto* newBuf= allocator().template AllocArray<TChar>( copy.Length() + 1);
177 copy.CopyTo( newBuf );
178 newBuf[base::length]= '\0';
179 base::buffer= newBuf;
180 }
181
182 //######################################### casting back ########################################
183// Doxygen (V1.15) would create identical entries in its tag-file, so those are not reachable.
184// On the other hand, it complains if the methods are not doxed. So, we hide them from doxygen.
185#if DOXYGEN
186 /// Templated \b implicit <c>cast operator</c> constructing an instance of type \p{T} from
187 /// this string instance, selected when type \p{T} satisfys one of he the concepts
188 /// - #"IsImplicitZTArrayCast" or #"IsExplicitZTArrayCast"
189 ///
190 /// Custom types can be enabled for this operator by specializing the traits-type
191 /// #"ArrayTraits", which is used for both;
192 /// the implementation of the concept, and the implementation of this operator itself.
193 ///
194 /// @tparam T The type to implicitly cast this instance to.
195 /// Requires satisfying the concept #"IsImplicitZTArrayCast".
196 /// Deduced by the compiler.
197 /// @return A value of type \p{T}.
198 template< typename T>
199 constexpr operator T() const;
200#else
201 template< typename T>
205 std::remove_cv_t<T> >::value )
206 constexpr operator T() const
208
209 template< typename T>
215 std::remove_cv_t<T> >::value )
216
217 constexpr explicit operator T() const
219
220 template< typename T>
221 requires ( !alib::characters::IsImplicitArrayCast <T, TChar>
225 std::remove_cv_t<T> >::value )
226
227 constexpr operator T() const
229
230
231 template< typename T>
236 std::remove_cv_t<T> >::value )
237 constexpr explicit operator T() const
239#endif
240
241 /// Reads a character at a given index.<br> Overrides
242 /// #"TString::operator[];String::operator[]" to change the debug assertion
243 /// to allow inclusion of the termination character.
244 ///
245 /// \attention
246 /// No parameter check is performed (other than an assertions in debug-compilation of
247 /// \alib). See #"TString::operator[];String::operator[]" for details.
248 ///
249 /// @param op The index of the character within this object's buffer.
250 /// @returns If the character contained at index \p{op}.
251 TChar operator[] (integer op) const {
252 ALIB_ASSERT_ERROR( op >= 0 && op <= base::length, "STRINGS",
253 "Index out of bounds: 0 <= {} < {}.", op, base::length )
254 return base::buffer[op];
255 }
256
257 /// Returns the index of the first character which is included, respectively <em>not</em>
258 /// included in a given set of characters.
259 ///
260 /// This method searches forwards. For backwards search, see
261 /// #"TString::LastIndexOfAny;String::LastIndexOfAny".
262 ///
263 /// \note
264 /// This method overrides method #"TString::IndexOfAny;String::IndexOf".
265 /// This implementation however expects a \b %CString with parameter \p{needles}
266 /// (beside the fact that it has to be invoked on a \b %CString itself).
267 /// If no zero-terminated needle string is available, the parent's original method
268 /// needs to be invoked. This has to be done by explicitly naming
269 /// the parent class in the invocation, like, for example, in
270 ///
271 /// myCString.TString::IndexOfAny<Inclusion::Include>( myString );
272 ///
273 /// \note
274 /// On most platforms, this zero-terminated version should perform slightly faster than
275 /// the original method in class \b %String.
276 ///
277 /// @tparam TCheck Defaults to #"CHK", which is the normal invocation mode.
278 /// If \c <false> is added to the method name, no parameter checks are
279 /// performed and the needles must not be empty.
280 /// @tparam TInclusion Denotes whether the search returns the first index that holds a value
281 /// that is included or that is not excluded in the set of needle
282 /// characters.
283 /// @param needles Set of characters to be taken into account.
284 /// @param startIdx The index to start the search at. If the given value is less than \c 0,
285 /// it is set to \c 0. If it exceeds the length of the string, the length of
286 /// the string is returned.
287 /// Defaults to \c 0.
288 ///
289 /// @return The index of the first character found which is included, respectively not
290 /// included, in the given set of characters. If nothing is found, \c -1 is returned.
291 template <lang::Inclusion TInclusion,
292 typename TCheck= CHK >
293 integer IndexOfAny( const TCString& needles, integer startIdx= 0 )
294 const {
295 if (TCheck::value) {
296 if ( startIdx < 0 ) startIdx= 0;
297 if ( startIdx >= base::length ) return -1;
298 } else {
299 ALIB_ASSERT_ERROR( startIdx >= 0
300 && startIdx < base::length
301 && needles.Length() != 0, "STRINGS",
302 "Non checking and illegal parameters: 0 <= {} < {}, needles: {}",
303 startIdx, base::length, needles.Length() )
304 }
305
306
307 if constexpr ( TInclusion == lang::Inclusion::Include ) {
309 return idx >= 0 ? idx + startIdx : -1;
310 } else {
311 const TChar* haystack= base::buffer + startIdx;
312 integer idx= characters::IndexOfAnyExcludedZT<TChar>( haystack, needles );
313 return idx < 0 || *( haystack + idx ) == '\0' ? -1 : startIdx + idx;
314 } }
315
316 /// Sets this object to a zero-terminated copy of the given string, allocated in
317 /// given \p{allocator}.
318 ///
319 /// \note
320 /// In case given \p{copy} is empty or nulled, no allocation is performed and this string
321 /// is set to empty. Still the pointer to the buffer is copied. Thus, this string
322 /// behaves in respect to method #"IsNull" the same as given string \p{copy}.
323 ///
324 /// @tparam TAllocator The type of the given \p{allocator}, as prototyped with the class
325 /// #"lang::Allocator". Deduced by the compiler.
326 /// @param allocator The allocator to use.
327 /// @param copy The string to copy to the new memory allocated.
328 template<typename TAllocator>
330 void Allocate( TAllocator& allocator, const TString<TChar>& copy ) {
331 if( (base::length= copy.Length()) == 0 ) {
332 base::buffer= copy.Buffer();
333 return;
334 }
335
336 auto* newBuf= allocator().template AllocArray<TChar>( base::length + 1);
337 copy.CopyTo( newBuf );
338 newBuf[base::length]= '\0';
339 base::buffer= newBuf;
340 }
341
342 /// Deallocates this String's memory in \p{allocator} and sets this instance to \e nulled.
343 ///
344 /// @see Notes in the similar method #"str TString::Free" of the base class, which
345 /// apply with this override likewise.
346 ///
347 /// @tparam TAllocator The type of the given \p{allocator}, as prototyped with
348 /// #"lang::Allocator". Deduced by the compiler.
349 /// @param allocator The allocator to use.
350 template<typename TAllocator>
352 void Free( TAllocator& allocator ) const {
353 if( base::length == 0 || base::buffer == nullptr )
354 return;
355 allocator().FreeArray( base::buffer, base::length + 1 );
356 }
357}; // class TCString
358
359//##################################################################################################
360// Specializations of ArrayTraits for this class CString
361//##################################################################################################
362#if !DOXYGEN
363
364// Suppress conversion of CString and AString to std::string. The rationale for this is
365// documented with ZTArrayTraits<std::basic_string> above.
366template<typename TChar>
367struct NoAutoCastTraits< TCString<TChar>,
368 characters::Policy::ExplicitOnly,
369 std::basic_string<TChar> > : std::true_type {};
370
371} ALIB_EXPORT namespace alib::characters {
372template<typename TChar> struct ZTArrayTraits<strings::TCString<TChar>, TChar>
373{
374 using T= strings::TCString<TChar>;
375 static constexpr Policy Access = Policy::Implicit;
376 static constexpr Policy Construction = Policy::ExplicitOnly;
377 static constexpr const TChar* Buffer(const T& src) { return src.Buffer(); }
378 static constexpr integer Length(const T& src) { return src.Length(); }
379 static constexpr T Construct(const TChar* b, integer l ) { return T(b, l); }
380};
381
382template<typename TChar> struct ArrayTraits<strings::TCString<TChar>, TChar>
383{
384 using T= strings::TCString<TChar>;
385 static constexpr Policy Access = Policy::Implicit;
386 static constexpr Policy Construction = Policy::ExplicitOnly;
387 static constexpr const TChar* Buffer(const T& src) { return src.Buffer(); }
388 static constexpr integer Length(const T& src) { return src.Length(); }
389
390 static constexpr T Construct(const TChar* b, integer l) { return T(b, l); }
391};
392
393
394#endif // !DOXYGEN
395
396} ALIB_EXPORT namespace alib {
397
398/// Type alias in namespace \b alib.
399using CString = strings::TCString <character>;
400
401/// Type alias in namespace \b alib.
402using ComplementCString= strings::TCString <complementChar>;
403
404/// Type alias in namespace \b alib.
405using StrangeCString = strings::TCString <strangeChar>;
406
407/// Type alias in namespace \b alib.
408using NCString = strings::TCString <nchar>;
409
410/// Type alias in namespace \b alib.
411using WCString = strings::TCString <wchar>;
412
413/// Type alias in namespace \b alib.
414using XCString = strings::TCString <xchar>;
415
416
417} ALIB_EXPORT namespace alib::strings {
418
419
420//==================================================================================================
421/// This template class has three specializations for types #"characters::nchar",
422/// #"characters::wchar", and #"characters::xchar", which each provide the following
423/// static \c constexpr methods:
424/// - #".EmptyString",
425/// - #".NewLine", and
426/// - #"DefaultWhitespaces".
427///
428/// The class is useful to implement methods that are templated with the character type they use.
429///
430/// \note
431/// In non-templated code (that works with fixed or logical character sizes), it might lead to
432/// better readability if the following shortcut/alias functions of namespace #"alib" are used:
433/// - #"EMPTY_CSTRING", #"EMPTY_COMPLEMENT_CSTRING", #"EMPTY_STRANGE_CSTRING",
434/// #"EMPTY_NCSTRING", #"EMPTY_WCSTRING", #"EMPTY_XCSTRING",
435/// - #"NEW_LINE", #"COMPLEMENT_NEW_LINE", #"STRANGE_NEW_LINE",
436/// #"NNEW_LINE", #"WNEW_LINE", #"XNEW_LINE" and
437/// - #"DEFAULT_WHITESPACES", #"COMPLEMENT_DEFAULT_WHITESPACES",
438/// #"STRANGE_DEFAULT_WHITESPACES", #"NDEFAULT_WHITESPACES", #"WDEFAULT_WHITESPACES",
439/// #"XDEFAULT_WHITESPACES".
440/// <p>
441///
442/// \note
443/// Constants for \e nulled strings are given with
444/// #"NULL_STRING", #"NULL_COMPLEMENT_STRING", #"NULL_STRANGE_STRING",
445/// #"NULL_NSTRING", #"NULL_WSTRING", and #"NULL_XSTRING". However, those are returning
446/// type \b String instead of \b CString. For \e nulled objects of type \b CString use the
447/// keyword \c nullptr which performs implicit constexpr creation.
448///
449/// \see
450/// See also manual chapter #"alib_strings_details_constants".
451///
452/// @tparam TChar The #"alib_characters_chars;character type".
453//==================================================================================================
454template<typename TChar>
456{
457 #if DOXYGEN
458 /// @return A \e zero-terminated empty string.
459 constexpr inline static CString<TChar> EmptyString();
460
461 /// On Windows OS, the returned string contains characters <c>'\\r'</c> and <c>'\\n'</c>, on
462 /// other platforms just character <c>'\\n'</c>.
463 /// @return A \e zero-terminated string containing platform-dependent "newline" charcater(s).
464 constexpr inline static CString<TChar> NewLine;
465
466 /// @return A zero-terminated string containing default whitespace characters "space", "newline"
467 /// "carriage return" and "tabulator", hence <c>" \n\r\t"</c>.
468 constexpr inline static CString<TChar> DefaultWhitespaces());
469 #endif
470};
471
472
473#if !DOXYGEN
474
475template<> struct CStringConstantsTraits<nchar>
476{
477 constexpr static NCString EmptyString() { return "" ; }
478
479 #if defined(_WIN32)
480 constexpr static NCString NewLine() { return "\r\n" ; }
481 #else
482 constexpr static NCString NewLine() { return "\n" ; }
483 #endif
484
485 constexpr static NCString DefaultWhitespaces() { return " \n\r\t" ; }
486};
487
488template<> struct CStringConstantsTraits<wchar>
489{
490 constexpr static WCString EmptyString() { return A_WCHAR("" ); }
491
492 #if defined(_WIN32)
493 constexpr static WCString NewLine() { return A_WCHAR("\r\n" ); }
494 #else
495 constexpr static WCString NewLine() { return A_WCHAR("\n" ); }
496 #endif
497
498 constexpr static WCString DefaultWhitespaces() { return A_WCHAR(" \n\r\t"); }
499};
500
501template<> struct CStringConstantsTraits<xchar>
502{
503 constexpr static XCString EmptyString() { return A_XCHAR("" ); }
504
505 #if defined(_WIN32)
506 constexpr static XCString NewLine() { return A_XCHAR("\r\n" ); }
507 #else
508 constexpr static XCString NewLine() { return A_XCHAR("\n" ); }
509 #endif
510
511 constexpr static XCString DefaultWhitespaces() { return A_XCHAR(" \n\r\t"); }
512};
513
514#endif //!DOXYGEN
515
516} ALIB_EXPORT namespace alib {
517
518
519/// A zero-terminated, empty string.
521
522/// A zero-terminated, empty string.
524
525/// A zero-terminated, empty string.
527
528/// A zero-terminated, empty string.
530
531/// A zero-terminated, empty string.
533
534/// A zero-terminated, empty string.
536
537
538
539/// A zero-terminated string containing the new-line character sequence.
541
542/// A zero-terminated string containing the new-line character sequence.
544
545/// A zero-terminated string containing the new-line character sequence.
547
548/// A zero-terminated string containing the new-line character sequence.
550
551/// A zero-terminated string containing the new-line character sequence.
553
554/// A zero-terminated string containing the new-line character sequence.
556
557
558
559/// A zero-terminated string of default whitespace characters.
561
562/// A zero-terminated string of default whitespace characters.
564
565/// A zero-terminated string of default whitespace characters.
567
568/// A zero-terminated string of default whitespace characters.
570
571/// A zero-terminated string of default whitespace characters.
573
574/// A zero-terminated string of default whitespace characters.
576
577
578} // namespace [alib]
579
580
581// Note(25/01/17):
582// Clang strangely did not find the following templated operators when they resided in an
583// exported namespace.
584// The workaround was to not export the namespace but export each operator instead.
585// We think this is wrong behavior and not aligned with the language specification.
586#if !DOXYGEN
587namespace alib::strings {
588
590template<typename TChar>
591bool operator== (const TCString<TChar>& lhs, const TCString<TChar>& rhs)
592{ return lhs. template Equals <CHK, lang::Case::Sensitive>(rhs); }
593
595template<typename TChar, typename T>
596requires (!std::is_same_v<T, TCString<TChar>>)
597bool operator== (const TCString<TChar>& lhs, const T& rhs)
598{ return lhs. template Equals <CHK, lang::Case::Sensitive>(rhs); }
599
601template<typename TChar>
602auto operator<=> (const TCString<TChar>& lhs, const TCString<TChar>& rhs)
603{ return lhs. template CompareTo<CHK, lang::Case::Sensitive>(rhs); }
604
606template<typename TChar, typename T>
607requires (!std::same_as<TCString<TChar>, T>)
608auto operator<=> (const TCString<TChar>& lhs, const T& rhs)
609{ return lhs. template CompareTo<CHK, lang::Case::Sensitive>(rhs); }
610
611} // namespace [alib::strings]
612#endif // !DOXYGEN
#define ALIB_ALLOW_DOCS
Definition alib.inl:662
#define ALIB_POP_ALLOWANCE
Definition alib.inl:673
#define A_XCHAR(STR)
Definition alib.inl:1305
#define ALIB_EXPORT
Definition alib.inl:562
#define ALIB_ASSERT_ERROR(cond, domain,...)
Definition alib.inl:1144
#define A_WCHAR(STR)
Definition alib.inl:1304
TString< TChar > base
Shortcut to the base type.
Definition cstring.inl:34
void Allocate(TAllocator &allocator, const TString< TChar > &copy)
Definition cstring.inl:330
constexpr TCString(const TChar *pBuffer, integer contentLength)
Definition cstring.inl:50
constexpr TCString(T src)
TChar operator[](integer op) const
Definition cstring.inl:251
integer IndexOfAny(const TCString &needles, integer startIdx=0) const
Definition cstring.inl:293
constexpr TCString()=default
Defaulted default constructor. Leaves this instance uninitialized and undefined.
TCString(TAllocator &allocator, const TString< TChar > &copy)
Definition cstring.inl:170
void Free(TAllocator &allocator) const
Definition cstring.inl:352
constexpr TCString(lang::IsNullptr auto const &) noexcept
Constructor accepting nullptr. Constructs a nulled string.
Definition cstring.inl:61
integer CopyTo(TChar *dest) const
Definition string.inl:1714
constexpr integer Length() const
Definition string.inl:304
constexpr const character * Buffer() const
Definition string.inl:299
constexpr TString() noexcept=default
constexpr bool IsNull() const
Definition string.inl:338
integer IndexOfAnyIncludedZT(const TChar *haystack, const TChar *needles)
integer IndexOfAnyExcludedZT(const TChar *haystack, const TChar *needles)
Inclusion
Denotes how members of a set something should be taken into account.
@ Include
Chooses inclusion.
auto operator<=>(const String &lhs, const String &rhs)
constexpr StrangeCString EMPTY_STRANGE_CSTRING
A zero-terminated, empty string.
Definition cstring.inl:526
constexpr StrangeCString STRANGE_NEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.inl:546
strings::TCString< wchar > WCString
Type alias in namespace alib.
Definition cstring.inl:411
strings::TCString< character > CString
Type alias in namespace alib.
Definition cstring.inl:399
constexpr WCString WNEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.inl:552
strings::TCString< nchar > NCString
Type alias in namespace alib.
Definition cstring.inl:408
constexpr ComplementCString COMPLEMENT_DEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.inl:563
constexpr CString NEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.inl:540
constexpr CString EMPTY_CSTRING
A zero-terminated, empty string.
Definition cstring.inl:520
characters::wchar wchar
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Definition integers.inl:149
constexpr NCString NNEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.inl:549
constexpr XCString XNEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.inl:555
characters::nchar nchar
Type alias in namespace alib.
constexpr XCString XDEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.inl:575
strings::TCString< xchar > XCString
Type alias in namespace alib.
Definition cstring.inl:414
constexpr CString DEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.inl:560
constexpr NCString NDEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.inl:569
strings::TCString< complementChar > ComplementCString
Type alias in namespace alib.
Definition cstring.inl:402
constexpr StrangeCString STRANGE_DEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.inl:566
constexpr WCString WDEFAULT_WHITESPACES
A zero-terminated string of default whitespace characters.
Definition cstring.inl:572
characters::xchar xchar
Type alias in namespace alib.
constexpr ComplementCString EMPTY_COMPLEMENT_CSTRING
A zero-terminated, empty string.
Definition cstring.inl:523
constexpr XCString EMPTY_XCSTRING
A zero-terminated, empty string.
Definition cstring.inl:535
constexpr WCString EMPTY_WCSTRING
A zero-terminated, empty string.
Definition cstring.inl:532
constexpr NCString EMPTY_NCSTRING
A zero-terminated, empty string.
Definition cstring.inl:529
constexpr ComplementCString COMPLEMENT_NEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.inl:543
strings::TCString< strangeChar > StrangeCString
Type alias in namespace alib.
Definition cstring.inl:405
See sibling type #"NC".
Definition chk_nc.inl:33
static constexpr Policy Access
static integer Length(const TStringSource &src)
static TStringSource Construct(const TChar *array, integer length)
static constexpr Policy Construction
static const TChar * Buffer(const TStringSource &src)
static constexpr Policy Construction
static constexpr Policy Access
static const TChar * Buffer(const TStringSource &src)
static TStringSource Construct(const TChar *array, integer length)
static integer Length(const TStringSource &src)
static constexpr CString< TChar > DefaultWhitespaces())
"carriage return" and "tabulator", hence " \n\r\t".
static constexpr CString< TChar > NewLine
Definition cstring.inl:464
static constexpr CString< TChar > EmptyString()