Ocean
Ocean::StringApple Class Reference

This class provides function allowing to convert Apple-platform specific string objects. More...

Static Public Member Functions

static NSString * toNSString (const std::string &value)
 Converts a given string to a NSString object. More...
 
static NSString * toNSString (const std::wstring &value)
 Converts a given string to a NSString object. More...
 
static std::string toUTF8 (NSString *object)
 Converts a given NSString object to a string with UTF8 encoding. More...
 
static std::wstring toWString (NSString *object)
 Converts a given NSString object to a string with 32 bit character encoding. More...
 
static std::string toUTF8 (CFStringRef object)
 Converts a given CFStringRef object to a string with UTF8 encoding. More...
 
static std::wstring toWString (CFStringRef object)
 Converts a given CFStringRef object to a string with 32 bit character encoding. More...
 

Detailed Description

This class provides function allowing to convert Apple-platform specific string objects.

Beware: This class is implemented for Apple-platforms only and therefore, it is recommended to use this class in non-header files only to reduce issues with the Objective C compiler.

Member Function Documentation

◆ toNSString() [1/2]

static NSString* Ocean::StringApple::toNSString ( const std::string &  value)
static

Converts a given string to a NSString object.

Parameters
valueThe string to convert, may be empty
Returns
The resulting converted string object

◆ toNSString() [2/2]

static NSString* Ocean::StringApple::toNSString ( const std::wstring &  value)
static

Converts a given string to a NSString object.

Parameters
valueThe string to convert, may be empty
Returns
The resulting converted string object

◆ toUTF8() [1/2]

static std::string Ocean::StringApple::toUTF8 ( CFStringRef  object)
static

Converts a given CFStringRef object to a string with UTF8 encoding.

Parameters
objectThe string object to convert, may be nullptr
Returns
The resulting string with UTF8 encoding

◆ toUTF8() [2/2]

static std::string Ocean::StringApple::toUTF8 ( NSString *  object)
static

Converts a given NSString object to a string with UTF8 encoding.

Parameters
objectThe string object to convert, may be nullptr
Returns
The resulting string with UTF8 encoding

◆ toWString() [1/2]

static std::wstring Ocean::StringApple::toWString ( CFStringRef  object)
static

Converts a given CFStringRef object to a string with 32 bit character encoding.

Parameters
objectThe string object to convert, may be nullptr
Returns
The resulting string with 32 bit character encoding

◆ toWString() [2/2]

static std::wstring Ocean::StringApple::toWString ( NSString *  object)
static

Converts a given NSString object to a string with 32 bit character encoding.

Parameters
objectThe string object to convert, may be nullptr
Returns
The resulting string with 32 bit character encoding

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