LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
EncodingTraits.hpp File Reference

Defines possible encodings together with their properties and related types. More...

Detailed Description

Defines possible encodings together with their properties and related types.

Date
Mar 23, 2018
Author
Rafal Chojna rafal.nosp@m.c@wo.nosp@m.lfram.nosp@m..com
#include <cstdint>
#include <string>
#include <type_traits>
#include <utility>
+ Include dependency graph for EncodingTraits.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LLU::WS::CharTypeStruct< E >
 
struct  LLU::WS::StringTypeStruct< E >
 
struct  LLU::WS::PutAs
 Utility structure used to enforce sending given value with encoding E via WSStream. More...
 
struct  LLU::WS::GetAs< E, T >
 Utility structure used to enforce receiving given value via WSStream with encoding E. More...
 

Namespaces

 LLU
 Main namespace of LibraryLink Utilities.
 
 LLU::WS
 Contains definitions related to WSTP functionality in LLU.
 

Type aliases

template<Encoding E>
using LLU::WS::CharType = typename CharTypeStruct< E >::type
 Specializations of CharTypeStruct, encoding E has assigned type T iff WSPutEString takes const T* as second parameter. More...
 
template<Encoding E>
using LLU::WS::StringType = typename StringTypeStruct< E >::type
 

Enumerations

enum  LLU::WS::Encoding : std::uint8_t {
  LLU::WS::Encoding::Undefined,
  LLU::WS::Encoding::Native,
  LLU::WS::Encoding::Byte,
  LLU::WS::Encoding::UTF8,
  LLU::WS::Encoding::UTF16,
  LLU::WS::Encoding::UCS2,
  LLU::WS::Encoding::UTF32
}
 

Functions

constexpr const char * LLU::WS::getEncodingName (Encoding e)
 Get the name of encoding. More...
 
template<Encoding E, typename T >
PutAs< E, T > LLU::WS::putAs (T &&obj)
 This is a helper function to facilitate constructing WS::PutAs wrapper. More...
 
template<Encoding E, typename T >
GetAs< E, T > LLU::WS::getAs (T &obj)
 This is a helper function to facilitate constructing WS::GetAs wrapper. More...
 

Variables

template<Encoding E, typename T >
constexpr bool LLU::WS::CharacterTypesCompatible = (sizeof(T) == sizeof(CharType<E>))
 Check whether character type T is compatible with encoding E (i.e. More...