Blender V5.0
GHOST_ISystemPaths.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
12
13#include "GHOST_ISystemPaths.hh"
14
15#ifdef WIN32
17#else
18# ifdef __APPLE__
20# else
22# endif
23#endif
24
25GHOST_ISystemPaths *GHOST_ISystemPaths::system_paths_ = nullptr;
26
28{
29 GHOST_TSuccess success;
30 if (!system_paths_) {
31#ifdef WIN32
32 system_paths_ = new GHOST_SystemPathsWin32();
33#else
34# ifdef __APPLE__
35 system_paths_ = new GHOST_SystemPathsCocoa();
36# else
37 system_paths_ = new GHOST_SystemPathsUnix();
38# endif
39#endif
40 success = system_paths_ != nullptr ? GHOST_kSuccess : GHOST_kFailure;
41 }
42 else {
43 success = GHOST_kFailure;
44 }
45 return success;
46}
47
49{
51 if (system_paths_) {
52 delete system_paths_;
53 system_paths_ = nullptr;
54 }
55 else {
56 success = GHOST_kFailure;
57 }
58 return success;
59}
60
62{
63 if (!system_paths_) {
64 create();
65 }
66 return system_paths_;
67}
GHOST_TSuccess
Definition GHOST_Types.h:57
@ GHOST_kFailure
Definition GHOST_Types.h:57
@ GHOST_kSuccess
Definition GHOST_Types.h:57
static GHOST_TSuccess create()
static GHOST_TSuccess dispose()
static GHOST_ISystemPaths * get()