ADTF
Loading...
Searching...
No Matches
adtf::streaming::stream_meta_type_string Struct Reference

Use this Stream Meta Type if your sample data will be any of this type: std::string, std::u16string. More...

#include <streammetatypestring.h>

Public Types

enum class  EncodingType {
  unknown = 0 , unspecified = 1 , c_char = 2 , utf8 = 3 ,
  w_char = 4 , w_char_16 = w_char , utf16 = 5
}
 The supported encoding types. More...
 

Static Public Member Functions

static void SetProperties (const adtf::ucom::iobject_ptr< adtf::base::IProperties > &pProperties)
 
static adtf_util::cString GetEncoding (const adtf::streaming::IStreamType &pStreamType)
 Get the Encoding Type as string.
 
static void SetEncoding (adtf::streaming::IStreamType &pStreamType, const char *strEncodingType)
 Set the Encoding type as string.
 
static EncodingType GetEncodingType (const adtf::streaming::IStreamType &pStreamType)
 Get the Encoding Type as part of the enumeration EncodingType.
 
static void SetEncodingType (adtf::streaming::IStreamType &pStreamType, EncodingType eEncodingType)
 Set the Encoding Type by given eEncodingType enumeration value.
 
static tResult IsCompatible (const adtf::streaming::IStreamType &oTypeToCheck, const adtf::streaming::IStreamType &oTypeExpected)
 Compares the oTypeExpected Stream Type with the oTypeToCheck - see Default Stream Meta Types for a summary of implementations.
 

Static Public Attributes

static constexpr const char *const MetaTypeName = "adtf/string"
 StreamMetaTypeName for string.
 
static constexpr const char *const DataEndianess = "data_endianess"
 Name for the Property of the data endianess (only necessary for encoding types greater that 8 Bit).
 
static constexpr const char *const Encoding = "encoding"
 encoding Property for string Stream Meta Type
 
static constexpr const char *const EncodingValueUnspecified = "unspecified"
 Valid value for Encoding property.
 
static constexpr const char *const EncodingValueCChar = "c-char"
 Valid value for Encoding property.
 
static constexpr const char *const EncodingValueUTF8 = "utf8"
 Valid value for Encoding property.
 
static constexpr const char *const EncodingValueWChar = "w-char"
 Valid value for Encoding property.
 
static constexpr const char *const EncodingValueUTF16 = "utf16"
 Valid value for Encoding property.
 

Detailed Description

Use this Stream Meta Type if your sample data will be any of this type: std::string, std::u16string.

brings latest penguin::stream_meta_type_plain to the users scope

Concept template to create the "adtf/string" Stream Meta Type for the generator template stream_meta_type.

Member Enumeration Documentation

◆ EncodingType

The supported encoding types.

Enumerator
unknown 

unknown type

unspecified 

any type means: for unspecified encodings, where i.e the receiver will determine the encoding while stream type change

c_char 

for plain char (8bit) used in c++ programs, where no special encoding information is used (usually USA ANSI7 or UTF-8) To read and write samples of this encoding type, we recommend to use std::string.

utf8 

utf8

w_char 

for plain char16_t (16bit) used in c++ programs, where no special encoding information is used (usually UTF-16LE without BO marker) To read and write samples of this type, we recommend to use std::u16string.

w_char_16 

for plain char16_t (16bit) used in c++ programs, where no special encoding information is used (usually UTF-16LE without BO marker) To read and write samples of this type, we recommend to use std::u16string.

utf16 

utf16

Member Function Documentation

◆ GetEncoding()

static adtf_util::cString adtf::streaming::penguin::stream_meta_type_string::GetEncoding ( const adtf::streaming::IStreamType & pStreamType)
inlinestatic

Get the Encoding Type as string.

Parameters
pStreamTypeThe streamtype to observe for property Encoding
Returns
adtf_util::cString

◆ GetEncodingType()

static EncodingType adtf::streaming::penguin::stream_meta_type_string::GetEncodingType ( const adtf::streaming::IStreamType & pStreamType)
inlinestatic

Get the Encoding Type as part of the enumeration EncodingType.

Parameters
pStreamTypethe streamtype to observe for property Encoding
Returns
EncodingType

◆ IsCompatible()

static tResult adtf::streaming::penguin::stream_meta_type_string::IsCompatible ( const adtf::streaming::IStreamType & oTypeToCheck,
const adtf::streaming::IStreamType & oTypeExpected )
inlinestatic

Compares the oTypeExpected Stream Type with the oTypeToCheck - see Default Stream Meta Types for a summary of implementations.

Compatible to all other stream types of any stream meta type, where the following conditions are met:

Parameters
[in]oTypeToCheckThe incoming type to check.
[in]oTypeExpectedThe expected type which values are more significant.
Return values
ERR_NOERRORtypes are compatible

◆ SetEncoding()

static void adtf::streaming::penguin::stream_meta_type_string::SetEncoding ( adtf::streaming::IStreamType & pStreamType,
const char * strEncodingType )
inlinestatic

Set the Encoding type as string.

Parameters
pStreamTypeThe streamtype to set the property Encoding
strEncodingTypeThe encoding type as string. See supported values at Encoding.

◆ SetEncodingType()

static void adtf::streaming::penguin::stream_meta_type_string::SetEncodingType ( adtf::streaming::IStreamType & pStreamType,
EncodingType eEncodingType )
inlinestatic

Set the Encoding Type by given eEncodingType enumeration value.

Parameters
pStreamTypeThe streamtype to set the property Encoding
eEncodingTypeThe encoding type

◆ SetProperties()

static void adtf::streaming::penguin::stream_meta_type_string::SetProperties ( const adtf::ucom::iobject_ptr< adtf::base::IProperties > & pProperties)
inlinestatic

Property setter for plaintype.

Member Data Documentation

◆ DataEndianess

const char* const adtf::streaming::penguin::stream_meta_type_string::DataEndianess = "data_endianess"
staticconstexpr

Name for the Property of the data endianess (only necessary for encoding types greater that 8 Bit).

Valid values are PLATFORM_LITTLE_ENDIAN_8 and PLATFORM_BIG_ENDIAN_8

◆ Encoding

const char* const adtf::streaming::penguin::stream_meta_type_string::Encoding = "encoding"
staticconstexpr

encoding Property for string Stream Meta Type

Valid values for this "encoding" property are:

  • unspecified - for unspecified encodings, where i.e the receiver will determine the encoding while stream type change
  • c-char - for plain char (8Bit) used in c++ programs, where no special encoding information is used
  • utf8 - utf8 (8Bit)
  • w-char - for plain wchar (16Bit !) used in c++ programs, where no special encoding information is used
  • utf16 - utf16 (16Bit)

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