PLCnext API Documentation  20.6.0.30321
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 
17 {
18 public: // typedefs
20 
21 public: // construction/destruction
23  IecString(uint16 capacityArg = 80);
25  IecString(const IecString& arg) = default;
27  IecString& operator=(const IecString& arg) = default;
29  ~IecString(void) = default;
30 
31 public: // operators
32 
33 public: // static operations
34 
35 public: // setter/getter operations
36  uint16 GetCapacity(void)const;
37  uint16 GetLength(void)const;
38 
39 public: // operations
40  void CopyTo(const IecString& other)const;
41  void CopyTo(String& other)const;
42  String ToString(void)const;
43 };
44 
46 // inline methods of class IecString
47 inline IecString::IecString(uint16 capacityArg)
48  : StaticStringBase(capacityArg)
49 {
50 }
51 
52 inline uint16 IecString::GetCapacity(void)const
53 {
54  return this->capacity;
55 }
56 
57 inline uint16 IecString::GetLength(void)const
58 {
59  return this->length;
60 }
61 
62 inline void IecString::CopyTo(String& other)const
63 {
64  other.Assign(this->GetData());
65 }
66 
67 inline IecString::String IecString::ToString(void)const
68 {
69  return String(this->GetData());
70 }
71 
72 }}}} // end of namespace Arp::Plc::Commons::Gds
This class represents the data type 'IecString'.
Definition: IecString.hpp:16
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:47
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