PLCnext API Documentation  21.0.0.35466
IecString.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/Plc/Commons/Gds/StaticStringBase.hpp"
9 
10 namespace Arp { namespace Plc { namespace Commons { namespace Gds
11 {
12 
19 {
20 public: // typedefs
22 
23 public: // construction/destruction
25  IecString(uint16 capacityArg = 80);
27  IecString(const IecString& arg) = default;
29  IecString& operator=(const IecString& arg) = default;
31  ~IecString(void) = default;
32 
33 public: // operators
34 
35 public: // static operations
36 
37 public: // setter/getter operations
38  uint16 GetCapacity(void)const;
39  uint16 GetLength(void)const;
40 
41 public: // operations
42  void CopyTo(const IecString& other)const;
43  void CopyTo(String& other)const;
44  String ToString(void)const;
45 };
46 
48 // inline methods of class IecString
49 inline IecString::IecString(uint16 capacityArg)
50  : StaticStringBase(capacityArg)
51 {
52 }
53 
54 inline uint16 IecString::GetCapacity(void)const
55 {
56  return this->capacity;
57 }
58 
59 inline uint16 IecString::GetLength(void)const
60 {
61  return this->length;
62 }
63 
64 inline void IecString::CopyTo(String& other)const
65 {
66  other.Assign(this->GetData());
67 }
68 
69 inline IecString::String IecString::ToString(void)const
70 {
71  return String(this->GetData());
72 }
73 
74 }}}} // end of namespace Arp::Plc::Commons::Gds
SelfType & Assign(SelfType &&arg)
This operation moves the as argument passed string to this string.
Definition: BasicString.hxx:316
This class represents the data type 'IecString' and is the counterpart of 'StaticString'. Note: This class is intended for internal use by PLCnext. Please do not use this class in applications or in any other way!
Definition: IecString.hpp:18
IecString & operator=(const IecString &arg)=default
Assignment operator.
~IecString(void)=default
Destructs this instance and frees all resources.
IecString(uint16 capacityArg=80)
Constructs an IecString instance.
Definition: IecString.hpp:49
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