ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings Namespace Reference

Description:

This is the reference documentation of sub-namespace strings of the ALib C++ Library, which holds types of library module ALib Strings.

Extensive documentation for this module is provided with ALib Module Strings - Programmer's Manual.

Nested Namespaces:

namespace  APPENDABLES
 
namespace  compatibility
 
namespace  detail
 This is a detail namespace of module ALib Strings.
 
namespace  util
 

Type Index:

struct  AppendableTraits
 
struct  AppendableTraits< TField< TChar >, TChar, TAllocator >
 
struct  CStringConstantsTraits
 
struct  NoAutoCastTraits
 
struct  NoAutoCastTraits< TAString< TChar, TAllocator >, characters::Policy::Implicit, TCString< TChar > >
 
struct  NoAutoCastTraits< TAString< TChar, TAllocator >, characters::Policy::Implicit, TSubstring< TChar > >
 
struct  NoAutoCastTraits< TCString< TChar >, characters::Policy::Implicit, TSubstring< TChar > >
 
struct  StringConstantsTraits
 
class  TAString
 
struct  TBin
 
class  TCString
 
class  TDec
 
struct  TEscape
 
struct  TField
 
struct  TFill
 
struct  THex
 
class  TLocalString
 
struct  TLocalStringNoWarning
 
struct  TNumberFormat
 
struct  TOct
 
class  TString
 
class  TStringLengthResetter
 
class  TStringNZT
 
class  TSubstring
 
struct  TTab
 

Concepts

concept  IsAppendable
 

Enumeration Index:

enum class  NumberFormatFlags : uint8_t {
  NONE = 0 , ReadGroupChars = 1 , WriteGroupChars = 2 , ForceDecimalPoint = 4 ,
  WriteExponentPlusSign = 8 , OmitTrailingFractionalZeros =16 , ReplaceLeadingZerosWithSpaces =32 , ForceScientific =64 ,
  HexLowerCase =128
}
 

Function Index:

Comparison Operators
auto operator<=> (const String &lhs, const String &rhs)
 

Variable Index:

constexpr integer MAX_LEN = (std::numeric_limits<integer>::max)()
 The maximum length of an ALib string.
 

Enumeration Details:

◆ NumberFormatFlags

enum class alib::strings::NumberFormatFlags : uint8_t
strong

Flags used with class TNumberFormat. By default (with construction of an instance of TNumberFormat), all flags are unset, except ForceDecimalPoint.

Enumerator
NONE 

If assigned, all flags are unset.

ReadGroupChars 

Denotes if grouping characters are ignored when parsing numbers if they are given (not set to '\0'). This applies to all number types.
Defaults to false. If set to true, grouping characters are just skipped when found while parsing numbers, no matter at which position they occur.

WriteGroupChars 

Denotes if grouping characters are written if they are given (not set to '\0'). This applies to all number types.

ForceDecimalPoint 

If true, the decimal point of floating point values is written, even if the fractional part of the float value is zero. If false, in this case the decimal point is omitted.
Defaults to true.

WriteExponentPlusSign 

Determines if positive exponent values are prepended with an explicit '+' character when written using WriteFloat.
Defaults to false, as some systems will not accept a plus sign on the exponent value. Note that field TNumberFormat::PlusSign is not applicable for exponent numbers.

OmitTrailingFractionalZeros 

If this flag ist set, then trailing '0' digits in the fractional part of a floating point value are not written, even if a TNumberFormat::FractionalPartWidth is set.

ReplaceLeadingZerosWithSpaces 

If this flag ist set, then leading '0' digits and group characters are replaced with spaces. This applies to integral values and to the integral part of floating point values, in the case that TNumberFormat::DecMinimumFieldWidth, respectively TNumberFormat::IntegralPartMinimumWidth, specifies the output to be wider than the number printed.

ForceScientific 

If true, scientific format is always used.
If false (the default), function WriteFloat writes scientific format only if both fields, TNumberFormat::IntegralPartMinimumWidth and TNumberFormat::FractionalPartWidth are evaluating to -1 and only for numbers smaller than 10E-04 or larger than 10E+06.

If one of the fields TNumberFormat::IntegralPartMinimumWidth or TNumberFormat::FractionalPartWidth is set to a positive value, these limits get extended. Function WriteFloat in this case keeps non-scientific notation established if possible.

HexLowerCase 

If true, lower case letters 'a' - 'f' are written. Defaults to false, which writes upper case letters 'A' - 'F'.

Definition at line 14 of file numberformat.inl.

Function Details:

◆ operator<=>()

auto alib::strings::operator<=> ( const String & lhs,
const String & rhs )

Starship operator and == operator for ALib Strings and compatible types.

The operators use methods lhs.Equals<CHK, lang::Case::Sensitive>(rhs), and lhs.CompareTo<CHK, lang::Case::Sensitive>(rhs) for evaluation.

For performance-critical sections, the original methods may be used where template parameter TCheck can be set to NC.

Note
For avoiding redundancy, only operator<=> is listed here in the documentation. Internally, different overloads with different requirements are used and, of course, operator== is likewise given.
Furthermore, all operators are available for the derived string types CString, AString and Substring likewise.
Parameters
lhsThe left-hand operand of string-like type.
rhsThe right-hand operand of string-like type.
Returns
The result of the comparison.

Definition at line 2282 of file string.inl.

Variable Details:

◆ MAX_LEN

integer alib::strings::MAX_LEN = (std::numeric_limits<integer>::max)()
inlineconstexpr

The maximum length of an ALib string.

Definition at line 51 of file string.inl.