Blender V4.3
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
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::m_systemPaths = nullptr;
26
28{
29 GHOST_TSuccess success;
30 if (!m_systemPaths) {
31#ifdef WIN32
32 m_systemPaths = new GHOST_SystemPathsWin32();
33#else
34# ifdef __APPLE__
35 m_systemPaths = new GHOST_SystemPathsCocoa();
36# else
37 m_systemPaths = new GHOST_SystemPathsUnix();
38# endif
39#endif
40 success = m_systemPaths != nullptr ? GHOST_kSuccess : GHOST_kFailure;
41 }
42 else {
43 success = GHOST_kFailure;
44 }
45 return success;
46}
47
49{
51 if (m_systemPaths) {
52 delete m_systemPaths;
53 m_systemPaths = nullptr;
54 }
55 else {
56 success = GHOST_kFailure;
57 }
58 return success;
59}
60
62{
63 if (!m_systemPaths) {
64 create();
65 }
66 return m_systemPaths;
67}
GHOST_TSuccess
Definition GHOST_Types.h:87
@ GHOST_kFailure
Definition GHOST_Types.h:87
@ GHOST_kSuccess
Definition GHOST_Types.h:87
static GHOST_TSuccess create()
static GHOST_TSuccess dispose()
static GHOST_ISystemPaths * get()