PLCnext API Documentation 25.0.2.69
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Arp::Base::Rsc::Commons::RscString< N > Class Template Reference

Contains a static string with string lentgh up to N characters. The string shall be null terminated. More...

#include <RscString.hxx>

Inheritance diagram for Arp::Base::Rsc::Commons::RscString< N >:
Inheritance graph

Public Member Functions

 RscString (void)
 Constructs an empty RscString.
 
 RscString (const char *pChars)
 Constructs an RscString instance and copies the null terminated c-string in internal buffer. More...
 
 RscString (const char8u *pChars)
 Constructs an RscString instance and copies the null terminated c-string in internal buffer. More...
 
 RscString (const String &arg)
 Constructor for type String. More...
 
 RscString (const RscString &arg)
 Default copy constructor. More...
 
 RscString (RscString &&arg) noexcept
 Default move constructor. More...
 
RscStringoperator= (const RscString &arg)
 Default copy-assignment operator. More...
 
RscStringoperator= (RscString &&arg) noexcept
 Default move-assignment operator. More...
 
 ~RscString (void)
 Default destructor.
 
RscStringoperator= (const char *pChars)
 Assigns the char buffer to this instance. More...
 
RscStringoperator= (const char8u *pChars)
 Assigns the UTF8 char buffer to this instance. More...
 
RscStringoperator= (const String &str)
 Assigns the String to this instance. More...
 
- Public Member Functions inherited from Arp::Base::Rsc::Commons::RscStringBase
 operator String (void) const
 Converts this object implicit to an instance of type String. More...
 
size_t GetLength (void) const
 Gets the length of this string. More...
 
const char * CStr (void) const
 Returns a const char pointer to the internal string buffer. More...
 
String ToString (void) const
 Converts this object to an instance of type String. More...
 
void Clear (void)
 Clears this instance resulting in an empty string.
 
void Assign (const char *pChars)
 Assigns the char buffer to this instance. More...
 
void Assign (const String &str)
 Assigns the String to this instance. More...
 
void Read (RscReader &reader)
 Reads this string from RSC. More...
 
void Write (RscWriter &writer) const
 Writes this string to RSC. More...
 

Static Public Member Functions

static constexpr size_t GetMaxLength (void)
 Get the maximal string length of this instance excluding string terminator. More...
 

Protected Member Functions

 RscString (RscType stringType)
 Constructor for type < see cref="RscSecureString"/>. More...
 
- Protected Member Functions inherited from Arp::Base::Rsc::Commons::RscStringBase
 RscStringBase (RscType stringType)
 Constructs an empty RscStringBase instance. More...
 
 RscStringBase (const RscStringBase &arg)
 Default copy constructor. More...
 
 RscStringBase (RscStringBase &&arg) noexcept
 Default move constructor. More...
 
RscStringBaseoperator= (const RscStringBase &arg)=delete
 
RscStringBaseoperator= (RscStringBase &&arg) noexcept=delete
 
 ~RscStringBase (void)
 Default destructor.
 
void SetBufferInfo (char *pStringBuffer, size_t bufferSize, size_t strLength=0)
 Constructs an empty RscStringBase instance. More...
 
void SetBufferInfo (char *pStringBuffer, size_t bufferSize, const char *pChars)
 Constructs a RscStringBase instance. More...
 
void SetBufferInfo (char *pStringBuffer, size_t bufferSize, const String &str)
 Constructs a RscStringBase instance. More...
 
void Assign (const char *pChars, size_t count)
 Copies the char buffer to this instance with a given length. More...
 
void SetStringType (RscType value)
 Sets the string type of this instance. More...
 
RscType GetStringType (void) const
 Gets the string type of this instance. More...
 

Detailed Description

template<int N>
class Arp::Base::Rsc::Commons::RscString< N >

Contains a static string with string lentgh up to N characters. The string shall be null terminated.

Template Parameters
NThe maximal length of the string, excluding NUL terminator.

Constructor & Destructor Documentation

◆ RscString() [1/6]

template<int N>
Arp::Base::Rsc::Commons::RscString< N >::RscString ( const char *  pChars)
inline

Constructs an RscString instance and copies the null terminated c-string in internal buffer.

Parameters
pCharsNull terminated string to copy into internal buffer

◆ RscString() [2/6]

template<int N>
Arp::Base::Rsc::Commons::RscString< N >::RscString ( const char8u *  pChars)
inline

Constructs an RscString instance and copies the null terminated c-string in internal buffer.

Parameters
pCharsNull terminated UTF8 string to copy into internal buffer.

◆ RscString() [3/6]

template<int N>
Arp::Base::Rsc::Commons::RscString< N >::RscString ( const String arg)
inline

Constructor for type String.

Parameters
argThe string to copy to this object.

◆ RscString() [4/6]

template<int N>
Arp::Base::Rsc::Commons::RscString< N >::RscString ( const RscString< N > &  arg)
inline

Default copy constructor.

Parameters
argThe argument to copy.

◆ RscString() [5/6]

template<int N>
Arp::Base::Rsc::Commons::RscString< N >::RscString ( RscString< N > &&  arg)
inlinenoexcept

Default move constructor.

Parameters
argThe argument to move.

◆ RscString() [6/6]

template<int N>
Arp::Base::Rsc::Commons::RscString< N >::RscString ( RscType  stringType)
inlineexplicitprotected

Constructor for type < see cref="RscSecureString"/>.

Parameters
stringTypeThe type of the string, i.e. <see cref=RscString"/> or <see cref=RscSecureString"/>.

Member Function Documentation

◆ GetMaxLength()

template<int N>
constexpr size_t Arp::Base::Rsc::Commons::RscString< N >::GetMaxLength ( void  )
inlinestaticconstexpr

Get the maximal string length of this instance excluding string terminator.

Returns
The max length of this string.

◆ operator=() [1/5]

template<int N>
RscString< N > & Arp::Base::Rsc::Commons::RscString< N >::operator= ( const char *  pChars)
inline

Assigns the char buffer to this instance.

Parameters
pCharsThe char buffer to assign to this instance.
Returns
This instance.

◆ operator=() [2/5]

template<int N>
RscString< N > & Arp::Base::Rsc::Commons::RscString< N >::operator= ( const char8u *  pChars)
inline

Assigns the UTF8 char buffer to this instance.

Parameters
pCharsThe UTF8 char buffer to assign to this instance.
Returns
This instance.

◆ operator=() [3/5]

template<int N>
RscString< N > & Arp::Base::Rsc::Commons::RscString< N >::operator= ( const RscString< N > &  arg)
inline

Default copy-assignment operator.

Parameters
argThe argument to copy.
Returns
This instance.

◆ operator=() [4/5]

template<int N>
RscString< N > & Arp::Base::Rsc::Commons::RscString< N >::operator= ( const String str)
inline

Assigns the String to this instance.

Parameters
strThe String to assign to this instance.
Returns
This instance.

◆ operator=() [5/5]

template<int N>
RscString< N > & Arp::Base::Rsc::Commons::RscString< N >::operator= ( RscString< N > &&  arg)
inlinenoexcept

Default move-assignment operator.

Parameters
argThe argument to move.
Returns
This instance.

The documentation for this class was generated from the following file: