PLCnext API Documentation  22.9.0.33
Utf16.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Commons/Encoding/EncodingResult.hpp"
9 
10 namespace Arp { namespace System { namespace Commons { namespace Encoding
11 {
12 
14 class Utf16
15 {
16 public: // construction/destruction/assignment
18  Utf16(void) = delete;
20  Utf16(const Utf16& arg) = delete;
22  Utf16(Utf16&& arg)noexcept = delete;
24  Utf16& operator=(const Utf16& arg) = delete;
26  Utf16& operator=(Utf16&& arg)noexcept = delete;
28  ~Utf16(void) = delete;
29 
30 public: // static operations
40  static EncodingResult ConvertToUtf8(const char16* pInput, size_t inputLength, char8* pResult, size_t resultCapacity, size_t& resultLength);
41 
51  static EncodingResult ConvertFromUtf8(const char8* pInput, size_t inputLength, char16* pResult, size_t resultCapacity, size_t& resultLength);
52 };
53 
54 }}}} // end of namespace Arp::System::Commons::Encoding
This static class provides encoding string operations from UTF8 to UTF16 or vice versa.
Definition: Utf16.hpp:15
Utf16(void)=delete
Deleted constructor.
Utf16(const Utf16 &arg)=delete
Deleted copy constructor.
Utf16(Utf16 &&arg) noexcept=delete
Deleted move constructor.
Utf16 & operator=(Utf16 &&arg) noexcept=delete
Deleted move-assignment operator.
~Utf16(void)=delete
Deleted destructor.
static EncodingResult ConvertFromUtf8(const char8 *pInput, size_t inputLength, char16 *pResult, size_t resultCapacity, size_t &resultLength)
This operation encodes an UTF8 string to an UTF16 string.
Utf16 & operator=(const Utf16 &arg)=delete
Deleted copy-assignment operator.
static EncodingResult ConvertToUtf8(const char16 *pInput, size_t inputLength, char8 *pResult, size_t resultCapacity, size_t &resultLength)
This operation encodes an UTF16 string to an UTF8 string.
char16_t char16
The Arp character type of 2 byte size.
Definition: PrimitiveTypes.hpp:49
char char8
The Arp character type of 1 byte size.
Definition: PrimitiveTypes.hpp:47
@ System
System components used by the System, Device, Plc or Io domains.
EncodingResult
This enum defines encoding results for operations of class Utf16.
Definition: EncodingResult.hpp:16
Root namespace for the PLCnext API