8 #include "Arp/Plc/Commons/Gds/StaticStringBase.hpp" 9 namespace Arp {
namespace Plc {
namespace Commons {
namespace Gds
16 template <u
int16 Capacity = 80>
39 uint16 GetLength(
void)
const;
42 String ToString(
void)
const;
45 bool IsEmpty(
void)
const;
48 char8 data[Capacity + 1];
58 memset(this->data, 0,
sizeof(this->data));
59 strncpy(this->data, str, this->capacity);
60 this->length = this->GetLength();
66 this->capacity = arg.capacity;
67 this->length = arg.length;
68 strncpy(this->data, arg.data, this->capacity);
74 if (arg.IsEmpty() ==
false)
76 memcpy(this->data, arg.GetData(), this->capacity);
77 this->length = arg.length;
86 strncpy(this->data, arg.GetData(), this->capacity);
87 this->length = this->GetLength();
94 size_t strLength = strlen(arg);
97 memset(this->data, 0,
sizeof(this->data));
98 strncpy(this->data, arg, this->capacity);
99 this->length = this->GetLength();
114 return (
uint16)(strlen(this->data));
120 return String(this->data);
126 if (strlen(this->data) == 0)
This class represents the counterpart to the data type 'IecString'. It's the C++ data type which can ...
Definition: StaticString.hxx:17
StaticString(const char8 *str="")
Constructs an StaticString instance.
Definition: StaticString.hxx:55
StaticString & operator=(const StaticString &arg)
Assignment operator.
Definition: StaticString.hxx:72
const CharType * CStr() const
Gets the character data of this string.
Definition: BasicString.hxx:1507
Root namespace for the PLCnext API
std::uint16_t uint16
The Arp unsigned integer type of 2 byte size.
Definition: PrimitiveTypes.hpp:31
This class is the base class used for 'IecString' and 'StaticString'.
Definition: StaticStringBase.hpp:15
~StaticString(void)=default
Destructs this instance and frees all resources.
char char8
The Arp character type of 1 byte size.
Definition: PrimitiveTypes.hpp:47