Blender
V2.93
intern
ghost
intern
GHOST_ISystemPaths.cpp
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*
16
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17
* All rights reserved.
18
*/
19
28
#include <stdio.h>
/* just for NULL */
29
30
#include "
GHOST_ISystemPaths.h
"
31
32
#ifdef WIN32
33
# include "
GHOST_SystemPathsWin32.h
"
34
#else
35
# ifdef __APPLE__
36
# include "
GHOST_SystemPathsCocoa.h
"
37
# else
38
# include "
GHOST_SystemPathsUnix.h
"
39
# endif
40
#endif
41
42
GHOST_ISystemPaths
*GHOST_ISystemPaths::m_systemPaths =
NULL
;
43
44
GHOST_TSuccess
GHOST_ISystemPaths::create
()
45
{
46
GHOST_TSuccess
success;
47
if
(!m_systemPaths) {
48
#ifdef WIN32
49
m_systemPaths =
new
GHOST_SystemPathsWin32
();
50
#else
51
# ifdef __APPLE__
52
m_systemPaths =
new
GHOST_SystemPathsCocoa
();
53
# else
54
m_systemPaths =
new
GHOST_SystemPathsUnix
();
55
# endif
56
#endif
57
success = m_systemPaths !=
NULL
?
GHOST_kSuccess
:
GHOST_kFailure
;
58
}
59
else
{
60
success =
GHOST_kFailure
;
61
}
62
return
success;
63
}
64
65
GHOST_TSuccess
GHOST_ISystemPaths::dispose
()
66
{
67
GHOST_TSuccess
success =
GHOST_kSuccess
;
68
if
(m_systemPaths) {
69
delete
m_systemPaths;
70
m_systemPaths =
NULL
;
71
}
72
else
{
73
success =
GHOST_kFailure
;
74
}
75
return
success;
76
}
77
78
GHOST_ISystemPaths
*
GHOST_ISystemPaths::get
()
79
{
80
if
(!m_systemPaths) {
81
create
();
82
}
83
return
m_systemPaths;
84
}
GHOST_ISystemPaths.h
GHOST_SystemPathsCocoa.h
GHOST_SystemPathsUnix.h
GHOST_SystemPathsWin32.h
GHOST_TSuccess
GHOST_TSuccess
Definition:
GHOST_Types.h:91
GHOST_kFailure
@ GHOST_kFailure
Definition:
GHOST_Types.h:91
GHOST_kSuccess
@ GHOST_kSuccess
Definition:
GHOST_Types.h:91
NULL
return NULL
Definition:
bmesh_operator_api_inline.h:224
GHOST_ISystemPaths
Definition:
GHOST_ISystemPaths.h:28
GHOST_ISystemPaths::create
static GHOST_TSuccess create()
Definition:
GHOST_ISystemPaths.cpp:44
GHOST_ISystemPaths::dispose
static GHOST_TSuccess dispose()
Definition:
GHOST_ISystemPaths.cpp:65
GHOST_ISystemPaths::get
static GHOST_ISystemPaths * get()
Definition:
GHOST_ISystemPaths.cpp:78
GHOST_SystemPathsCocoa
Definition:
GHOST_SystemPathsCocoa.h:32
GHOST_SystemPathsUnix
Definition:
GHOST_SystemPathsUnix.h:29
GHOST_SystemPathsWin32
Definition:
GHOST_SystemPathsWin32.h:39
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1