8#include "Arp/Base/Core/SecureString.hpp"
9#include "Arp/Base/Rsc/Commons/RscStringBase.hpp"
10#include "Arp/Base/Commons/Exceptions/ArgumentException.hpp"
14namespace Arp::Base::Rsc::Commons
74 const static size_t maxLength = N;
75 const static size_t bufferSize = maxLength + 1;
78 std::array<char, bufferSize> buffer{};
127 this->buffer = arg.buffer;
139 this->buffer = arg.buffer;
166 :
RscString(reinterpret_cast<const char*>(pChars))
193 this->Assign(pChars);
203 this->Assign(
reinterpret_cast<const char*
>(pChars));
222struct fmt::formatter<
Arp::Base::Rsc::Commons::RscString<N>> :
public fmt::ostream_formatter {};
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
size_type Length(void) const
Returns the number of char elements in this string.
Definition: String.ipp:954
const CharType * CStr(void) const
Gets the character data of this string.
Definition: String.ipp:1395
This class is a base class of template class RscString.
Definition: RscStringBase.hpp:27
void SetStringType(RscType value)
Sets the string type of this instance.
Definition: RscStringBase.cpp:171
size_t GetLength(void) const
Gets the length of this string.
Definition: RscStringBase.cpp:49
const char * CStr(void) const
Returns a const char pointer to the internal string buffer.
Definition: RscStringBase.cpp:63
void SetBufferInfo(char *pStringBuffer, size_t bufferSize, size_t strLength=0)
Constructs an empty RscStringBase instance.
Definition: RscStringBase.cpp:93
Contains a static string with string lentgh up to N characters. The string shall be null terminated.
Definition: RscString.hxx:24
RscString(const char *pChars)
Constructs an RscString instance and copies the null terminated c-string in internal buffer.
Definition: RscString.hxx:154
RscString(const RscString &arg)
Default copy constructor.
Definition: RscString.hxx:104
RscString(const char8u *pChars)
Constructs an RscString instance and copies the null terminated c-string in internal buffer.
Definition: RscString.hxx:165
RscString & operator=(const RscString &arg)
Default copy-assignment operator.
Definition: RscString.hxx:125
RscString(void)
Constructs an empty RscString.
Definition: RscString.hxx:86
RscString & operator=(const char8u *pChars)
Assigns the UTF8 char buffer to this instance.
Definition: RscString.hxx:201
friend std::ostream & operator<<(std::ostream &os, const RscString &str)
The ostream operator is used for logging and string formatting.
Definition: RscString.hxx:49
RscString & operator=(const String &str)
Assigns the String to this instance.
Definition: RscString.hxx:211
static constexpr size_t GetMaxLength(void)
Get the maximal string length of this instance excluding string terminator.
Definition: RscString.hxx:182
RscString & operator=(const char *pChars)
Assigns the char buffer to this instance.
Definition: RscString.hxx:191
RscString(RscType stringType)
Constructor for type < see cref="RscSecureString"/>.
Definition: RscString.hxx:95
RscString & operator=(RscString &&arg) noexcept
Default move-assignment operator.
Definition: RscString.hxx:137
~RscString(void)
Default destructor.
friend std::istream & operator>>(std::istream &is, RscString &str)
The istream operator is used for string parsing.
Definition: RscString.hxx:59
RscString(RscString &&arg) noexcept
Default move constructor.
Definition: RscString.hxx:114
RscString(const String &arg)
Constructor for type String.
Definition: RscString.hxx:173
char8_t char8u
The Arp UTF8 character type of 1 byte size.
Definition: PrimitiveTypes.hpp:47
Root namespace for the PLCnext API