Blender
V4.3
intern
ghost
intern
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
16
# include "
GHOST_SystemPathsWin32.hh
"
17
#else
18
# ifdef __APPLE__
19
# include "
GHOST_SystemPathsCocoa.hh
"
20
# else
21
# include "
GHOST_SystemPathsUnix.hh
"
22
# endif
23
#endif
24
25
GHOST_ISystemPaths
*GHOST_ISystemPaths::m_systemPaths =
nullptr
;
26
27
GHOST_TSuccess
GHOST_ISystemPaths::create
()
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
48
GHOST_TSuccess
GHOST_ISystemPaths::dispose
()
49
{
50
GHOST_TSuccess
success =
GHOST_kSuccess
;
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
61
GHOST_ISystemPaths
*
GHOST_ISystemPaths::get
()
62
{
63
if
(!m_systemPaths) {
64
create
();
65
}
66
return
m_systemPaths;
67
}
GHOST_ISystemPaths.hh
GHOST_SystemPathsCocoa.hh
GHOST_SystemPathsUnix.hh
GHOST_SystemPathsWin32.hh
GHOST_TSuccess
GHOST_TSuccess
Definition
GHOST_Types.h:87
GHOST_kFailure
@ GHOST_kFailure
Definition
GHOST_Types.h:87
GHOST_kSuccess
@ GHOST_kSuccess
Definition
GHOST_Types.h:87
GHOST_ISystemPaths
Definition
GHOST_ISystemPaths.hh:13
GHOST_ISystemPaths::create
static GHOST_TSuccess create()
Definition
GHOST_ISystemPaths.cc:27
GHOST_ISystemPaths::dispose
static GHOST_TSuccess dispose()
Definition
GHOST_ISystemPaths.cc:48
GHOST_ISystemPaths::get
static GHOST_ISystemPaths * get()
Definition
GHOST_ISystemPaths.cc:61
GHOST_SystemPathsCocoa
Definition
GHOST_SystemPathsCocoa.hh:17
GHOST_SystemPathsUnix
Definition
GHOST_SystemPathsUnix.hh:14
GHOST_SystemPathsWin32
Definition
GHOST_SystemPathsWin32.hh:24
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0