Blender
V5.0
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
8
12
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::system_paths_ =
nullptr
;
26
27
GHOST_TSuccess
GHOST_ISystemPaths::create
()
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
48
GHOST_TSuccess
GHOST_ISystemPaths::dispose
()
49
{
50
GHOST_TSuccess
success =
GHOST_kSuccess
;
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
61
GHOST_ISystemPaths
*
GHOST_ISystemPaths::get
()
62
{
63
if
(!system_paths_) {
64
create
();
65
}
66
return
system_paths_;
67
}
GHOST_ISystemPaths.hh
GHOST_SystemPathsCocoa.hh
GHOST_SystemPathsUnix.hh
GHOST_SystemPathsWin32.hh
GHOST_TSuccess
GHOST_TSuccess
Definition
GHOST_Types.h:57
GHOST_kFailure
@ GHOST_kFailure
Definition
GHOST_Types.h:57
GHOST_kSuccess
@ GHOST_kSuccess
Definition
GHOST_Types.h:57
GHOST_ISystemPaths
Definition
GHOST_ISystemPaths.hh:16
GHOST_ISystemPaths::create
static GHOST_TSuccess create()
Definition
GHOST_ISystemPaths.cc:27
GHOST_ISystemPaths::GHOST_ISystemPaths
GHOST_ISystemPaths()
Definition
GHOST_ISystemPaths.hh:41
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:20
GHOST_SystemPathsUnix
Definition
GHOST_SystemPathsUnix.hh:17
GHOST_SystemPathsWin32
Definition
GHOST_SystemPathsWin32.hh:27
Generated on
for Blender by
doxygen
1.16.1