Ocean
platform/Utilities.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_PLATFORM_UTILITIES_H
9 #define META_OCEAN_PLATFORM_UTILITIES_H
10 
12 
13 namespace Ocean
14 {
15 
16 namespace Platform
17 {
18 
19 /**
20  * This class implements utilities and helper functions.
21  * @ingroup platform
22  */
23 class OCEAN_PLATFORM_EXPORT Utilities
24 {
25  public:
26 
27  /**
28  * Definition of a vector holding application commands.
29  */
30  typedef std::vector<std::wstring> Commands;
31 
32  public:
33 
34  /**
35  * Parses the command line and returns the individual command elements.
36  * The entire command line may contain several commands separated by space characters.<br>
37  * Command elements which contain space characters must be surrounded by quotation marks.<br>
38  * However, all surrounding quotation marks will be removed during the parsing process.<br>
39  * The first argument should not be the filename (and path) of the executable.
40  * @param commandLine Command line to be parsed
41  * @return Individual commands
42  */
43  static Commands parseCommandLine(const wchar_t* commandLine);
44 
45  /**
46  * Shows a modal message box with a title, a message and an OK button.
47  * Beware: This function is supported for Desktop platforms only.
48  * @param title The title to be shown in the box
49  * @param message The message to be shown in the box
50  */
51  static void showMessageBox(const std::string& title, const std::string& message);
52 
53 #ifdef __APPLE__
54 
55  /**
56  * Shows a modal message box with a title, a message and an OK button on Apple platforms only.
57  * Beware: This function is supported for Desktop platforms only.
58  * @param title The title to be shown in the box
59  * @param message The message to be shown in the box
60  */
61  static void showMessageBoxApple(const std::string& title, const std::string& message);
62 
63 #endif
64 
65 };
66 
67 }
68 
69 }
70 
71 #endif // META_OCEAN_PLATFORM_UTILITIES_H
This class implements utilities and helper functions.
Definition: platform/Utilities.h:24
static void showMessageBoxApple(const std::string &title, const std::string &message)
Shows a modal message box with a title, a message and an OK button on Apple platforms only.
static void showMessageBox(const std::string &title, const std::string &message)
Shows a modal message box with a title, a message and an OK button.
static Commands parseCommandLine(const wchar_t *commandLine)
Parses the command line and returns the individual command elements.
std::vector< std::wstring > Commands
Definition of a vector holding application commands.
Definition: platform/Utilities.h:30
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15