Safir SDK Core
Loading...
Searching...
No Matches
Safir::Dob::Typesystem::Utilities Namespace Reference

Utility functions for users of the DOB type system. More...

Functions

DOTS_CPP_API const std::string ToUtf8 (const std::wstring &wstr)
 Convert a std::wstring to UTF8-encoded std::string.
 
DOTS_CPP_API const std::wstring ToWstring (const std::string &str)
 Convert a UTF8-encoded std::string to std::wstring.
 
DOTS_CPP_API void MergeChanges (ObjectPtr into, const ObjectConstPtr &from)
 Merge the changed members (recursively) from one object into another.
 
DOTS_CPP_API const std::string BinaryToBase64 (char const *const binarySource, int sourceSize)
 Converts binary data to Base64.
 
DOTS_CPP_API const std::string BinaryToBase64 (const Dob::Typesystem::Binary &bin)
 Converts binary data to Base64.
 
DOTS_CPP_API void Base64ToBinary (const std::string &base64Str, Dob::Typesystem::Binary &binary)
 Converts data in Base64 format into binary data format.
 

Detailed Description

Utility functions for users of the DOB type system.

Function Documentation

◆ Base64ToBinary()

DOTS_CPP_API void Safir::Dob::Typesystem::Utilities::Base64ToBinary ( const std::string & base64Str,
Dob::Typesystem::Binary & binary )

Converts data in Base64 format into binary data format.

Will convert data from Base64 format to binary format.

Parameters
base64Str[in] - Base64 data to convert.
binary[out] - binary serialization that will contain the result.

◆ BinaryToBase64() [1/2]

DOTS_CPP_API const std::string Safir::Dob::Typesystem::Utilities::BinaryToBase64 ( char const *const binarySource,
int sourceSize )

Converts binary data to Base64.

Will convert the binarySource to Base64 format.

Parameters
binarySource[in] - pointer to the binary data to be converted.
sourceSize[in] - number of bytes to convert.
Returns
The a string containing the Base64 representation of the binary source.

◆ BinaryToBase64() [2/2]

DOTS_CPP_API const std::string Safir::Dob::Typesystem::Utilities::BinaryToBase64 ( const Dob::Typesystem::Binary & bin)

Converts binary data to Base64.

Will convert the binarySource to Base64 format.

Parameters
bin[in] - binary data to convert.
Returns
A string containing the Base64 representation of the binary source.

◆ MergeChanges()

DOTS_CPP_API void Safir::Dob::Typesystem::Utilities::MergeChanges ( ObjectPtr into,
const ObjectConstPtr & from )

Merge the changed members (recursively) from one object into another.

This function will recurse through the members of the "from" object and take all the members that have a change flag set and copy them into the "into" object.

Parameters
into[in] - Object to merge into.
from[in,out] - Object whose changes shall be merged into "into".

◆ ToUtf8()

DOTS_CPP_API const std::string Safir::Dob::Typesystem::Utilities::ToUtf8 ( const std::wstring & wstr)

Convert a std::wstring to UTF8-encoded std::string.

Parameters
wstr[in] - The wstring to convert.
Returns
- The string in UTF8 format.

Referenced by Safir::Dob::Typesystem::ChannelId::Utf8String(), Safir::Dob::Typesystem::HandlerId::Utf8String(), Safir::Dob::Typesystem::InstanceId::Utf8String(), Safir::Dob::Typesystem::StringContainer::Utf8String(), Safir::Dob::Typesystem::ChannelId::Utf8StringLength(), Safir::Dob::Typesystem::HandlerId::Utf8StringLength(), Safir::Dob::Typesystem::InstanceId::Utf8StringLength(), and Safir::Dob::Typesystem::StringContainer::Utf8StringLength().

Here is the caller graph for this function:

◆ ToWstring()

DOTS_CPP_API const std::wstring Safir::Dob::Typesystem::Utilities::ToWstring ( const std::string & str)

Convert a UTF8-encoded std::string to std::wstring.

Parameters
str[in] - The string to convert.
Returns
- The wide string.