This class implements utilitiy functions for Apple platforms.
More...
This class implements utilitiy functions for Apple platforms.
◆ asNSImageOrUIImage()
static bool Ocean::Platform::Apple::Utilities::asNSImageOrUIImage |
( |
const Frame & |
frame | ) |
|
|
static |
This function is a simple helper function to debug a frame on iOS or macOS.
Within the function, Xcode's Quick look
debugging functionality can be used to visualize the image's content.
- Parameters
-
frame | The frame to be debugged, must be valid |
- Returns
- True, if the frame could be handled
- See also
- toCGImage().
◆ bundleIdentifier()
static bool Ocean::Platform::Apple::Utilities::bundleIdentifier |
( |
std::string & |
bundleIdentifier, |
|
|
std::string * |
bundleIdentifierKey = nullptr |
|
) |
| |
|
static |
Returns the application's identifier name.
- Parameters
-
bundleIdentifier | The resulting release identifier number of the bundle |
bundleIdentifierKey | Optional resulting identifier key of the bundle, nullptr if not of interest |
- Returns
- True, if succeeded
◆ bundleVersion()
static bool Ocean::Platform::Apple::Utilities::bundleVersion |
( |
std::string & |
bundleShortVersion, |
|
|
std::string * |
bundleVersionKey = nullptr |
|
) |
| |
|
static |
Returns the application's version number.
- Parameters
-
bundleShortVersion | The resulting release version number of the bundle |
bundleVersionKey | Optional resulting version key of the bundle, nullptr if not of interest |
- Returns
- True, if succeeded
◆ documentDirectory()
static std::string Ocean::Platform::Apple::Utilities::documentDirectory |
( |
| ) |
|
|
static |
Returns the path to the document directory of the application.
In a non-sandboxed application (e.g., a Mac console application), path will refer to the Documents folder in home.
In a sandboxed application (e.g., an iOS app), the path will refer to the Document folder of the app.
On iOS, you can use this path to the folder to e.g., to store files in the folder,
and you can access the data later using Apple's file sharing/accessing capabilities. Beware: You may need/want to add a 'UIFileSharingEnabled' key and a 'LSSupportsOpeningDocumentsInPlace' to the 'Info.plist' file of the application and set both to 'True'.
- Returns
- The document directory's path
◆ hasFixedSupportedInterfaceOrientation()
static bool Ocean::Platform::Apple::Utilities::hasFixedSupportedInterfaceOrientation |
( |
int & |
zAxisDegree | ) |
|
|
static |
Returns whether the application's main window has exactly one supported interface orientation.
device top
...........................
. .
. ^ .
. Y | .
. | .
. | .
. O ---------> .
. / X .
. / Z .
. v .
. .
...........................
. home button .
...........................
device bottom
- Parameters
-
zAxisDegree | The resulting angle of the supported orientation around the z-axis, possible values {-90, 0, 90, 180} |
- Returns
- True, if so
◆ showMessageBox()
static void Ocean::Platform::Apple::Utilities::showMessageBox |
( |
const std::string & |
title, |
|
|
const std::string & |
message |
|
) |
| |
|
static |
Shows a modal message box with a title, a message and an OK button.
Beware: This function is not supported on iOS.
- Parameters
-
title | The title to be shown in the box |
message | The message to be shown in the box |
◆ toCFString() [1/2]
static ScopedCFStringRef Ocean::Platform::Apple::Utilities::toCFString |
( |
const std::string & |
value | ) |
|
|
static |
Converts a given string to a CFString reference object.
Beware: The resulting string must be released via CFRelease once the string is not needed anymore.
- Parameters
-
value | The string to convert, may be empty |
- Returns
- The resulting converted string object
◆ toCFString() [2/2]
static ScopedCFStringRef Ocean::Platform::Apple::Utilities::toCFString |
( |
const std::wstring & |
value | ) |
|
|
static |
Converts a given string to a CFString reference object.
Beware: The resulting string must be released via CFRelease once the string is not needed anymore.
- Parameters
-
value | The string to convert, may be empty |
- Returns
- The resulting converted string object
◆ toCGImage()
static ScopedCGImageRef Ocean::Platform::Apple::Utilities::toCGImage |
( |
const Frame & |
frame, |
|
|
bool |
copyData = true |
|
) |
| |
|
static |
Creates an CGImage object for a given frame object.
The frame data can either be copied or used only.
If the frame data is not copied, the frame data must exist as long as any related object exists relying on the resulting CGImage.
Beware: The caller has to release the image object by calling CGImageRelease.
This function can be used to e.g., debug a Frame object within Xcode by using the Quick look
functionality. Here is a code example how to debug the an image:
#import <UIKit/UIKit.h>
UIImage* image = [[UIImage alloc] initWithCGImage:cgImage];
- Parameters
-
frame | The frame from which the CGImage object will be created |
copyData | True, to create an CGImage object owning the frame data; False, to create an CGImageo object using the frame data only |
- Returns
- The resulting CGImage object, nullptr if the conversion failed
- See also
- asNSImageOrUIImage().
The documentation for this class was generated from the following file: