Blender
V3.3
intern
ghost
intern
GHOST_ISystemPaths.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later
2
* Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3
12
#include "
GHOST_ISystemPaths.h
"
13
14
#ifdef WIN32
15
# include "
GHOST_SystemPathsWin32.h
"
16
#else
17
# ifdef __APPLE__
18
# include "
GHOST_SystemPathsCocoa.h
"
19
# else
20
# include "
GHOST_SystemPathsUnix.h
"
21
# endif
22
#endif
23
24
GHOST_ISystemPaths
*GHOST_ISystemPaths::m_systemPaths =
nullptr
;
25
26
GHOST_TSuccess
GHOST_ISystemPaths::create
()
27
{
28
GHOST_TSuccess
success;
29
if
(!m_systemPaths) {
30
#ifdef WIN32
31
m_systemPaths =
new
GHOST_SystemPathsWin32
();
32
#else
33
# ifdef __APPLE__
34
m_systemPaths =
new
GHOST_SystemPathsCocoa
();
35
# else
36
m_systemPaths =
new
GHOST_SystemPathsUnix
();
37
# endif
38
#endif
39
success = m_systemPaths !=
nullptr
?
GHOST_kSuccess
:
GHOST_kFailure
;
40
}
41
else
{
42
success =
GHOST_kFailure
;
43
}
44
return
success;
45
}
46
47
GHOST_TSuccess
GHOST_ISystemPaths::dispose
()
48
{
49
GHOST_TSuccess
success =
GHOST_kSuccess
;
50
if
(m_systemPaths) {
51
delete
m_systemPaths;
52
m_systemPaths =
nullptr
;
53
}
54
else
{
55
success =
GHOST_kFailure
;
56
}
57
return
success;
58
}
59
60
GHOST_ISystemPaths
*
GHOST_ISystemPaths::get
()
61
{
62
if
(!m_systemPaths) {
63
create
();
64
}
65
return
m_systemPaths;
66
}
GHOST_ISystemPaths.h
GHOST_SystemPathsCocoa.h
GHOST_SystemPathsUnix.h
GHOST_SystemPathsWin32.h
GHOST_TSuccess
GHOST_TSuccess
Definition:
GHOST_Types.h:74
GHOST_kFailure
@ GHOST_kFailure
Definition:
GHOST_Types.h:74
GHOST_kSuccess
@ GHOST_kSuccess
Definition:
GHOST_Types.h:74
GHOST_ISystemPaths
Definition:
GHOST_ISystemPaths.h:12
GHOST_ISystemPaths::create
static GHOST_TSuccess create()
Definition:
GHOST_ISystemPaths.cpp:26
GHOST_ISystemPaths::dispose
static GHOST_TSuccess dispose()
Definition:
GHOST_ISystemPaths.cpp:47
GHOST_ISystemPaths::get
static GHOST_ISystemPaths * get()
Definition:
GHOST_ISystemPaths.cpp:60
GHOST_SystemPathsCocoa
Definition:
GHOST_SystemPathsCocoa.h:16
GHOST_SystemPathsUnix
Definition:
GHOST_SystemPathsUnix.h:13
GHOST_SystemPathsWin32
Definition:
GHOST_SystemPathsWin32.h:23
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1