ADTF  3.18.2
stream_meta_type_string

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

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)
 Property setter for plaintype.
 
static adtf_util::cString GetEncoding (const adtf::streaming::IStreamType &pStreamType)
 Get the Encoding Type as string. More...
 
static void SetEncoding (adtf::streaming::IStreamType &pStreamType, const char *strEncodingType)
 Set the Encoding type as string. More...
 
static EncodingType GetEncodingType (const adtf::streaming::IStreamType &pStreamType)
 Get the Encoding Type as part of the enumeration EncodingType. More...
 
static void SetEncodingType (adtf::streaming::IStreamType &pStreamType, EncodingType eEncodingType)
 Set the Encoding Type by given eEncodingType enumeration value. More...
 
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 in ADTF for a summary of implementations. More...
 

Static Public Attributes

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

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

See also
Stream Meta Type "adtf/string"
Demo String Handling Filters Plugin

Definition at line 30 of file streammetatypestring.h.

Member Enumeration Documentation

◆ EncodingType

enum EncodingType
strong

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 
utf16 

utf16

Definition at line 44 of file streammetatypestring.h.

Member Function Documentation

◆ GetEncoding()

static adtf_util::cString 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

Definition at line 114 of file streammetatypestring.h.

◆ GetEncodingType()

static EncodingType 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

Definition at line 151 of file streammetatypestring.h.

◆ IsCompatible()

static tResult 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 in ADTF for a summary of implementations.

Compatible to all other stream types of any Stream Meta Type, where the following conditions are met:

Remarks
: For a complete definition of the delivered default types and the information of which Stream Type is compatible to another one then see Default Stream Meta Types in ADTF.
Parameters
[in]oTypeToCheckThe incoming type to check.
[in]oTypeExpectedThe expected type which values are more significant.
Return values
ERR_NOERRORtypes are compatible
See also
Default Stream Meta Types in ADTF, AcceptType and IsCompatible implementations.

Definition at line 240 of file streammetatypestring.h.

References stream_meta_type_string::DataEndianess, stream_meta_type_string::Encoding, stream_meta_type_string::EncodingValueCChar, stream_meta_type_string::EncodingValueUnspecified, stream_meta_type_string::EncodingValueUTF8, IStreamType::GetConfig(), PLATFORM_LITTLE_ENDIAN_8, RETURN_ERROR_DESC, RETURN_IF_FAILED, and RETURN_NOERROR.

◆ SetEncoding()

static void 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.

Definition at line 132 of file streammetatypestring.h.

◆ SetEncodingType()

static void 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

Definition at line 184 of file streammetatypestring.h.

Member Data Documentation

◆ DataEndianess

constexpr const tChar* const 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

Definition at line 39 of file streammetatypestring.h.

Referenced by stream_meta_type_string::IsCompatible(), and stream_meta_type_string::SetProperties().

◆ Encoding

constexpr const tChar* const 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)

Definition at line 88 of file streammetatypestring.h.

Referenced by stream_meta_type_string::IsCompatible(), and stream_meta_type_string::SetProperties().