Blender V4.3
GHOST_Path-api.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2010 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdio>
10
11#include "GHOST_ISystemPaths.hh"
12#include "GHOST_Path-api.hh"
13#include "GHOST_Types.h"
14#include "intern/GHOST_Debug.hh"
15
20
25
26const char *GHOST_getSystemDir(int version, const char *versionstr)
27{
28 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
29 return systemPaths ? systemPaths->getSystemDir(version, versionstr) : nullptr;
30}
31
32const char *GHOST_getUserDir(int version, const char *versionstr)
33{
34 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
35 /* Shouldn't be `nullptr`. */
36 return systemPaths ? systemPaths->getUserDir(version, versionstr) : nullptr;
37}
38
40{
41 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
42 /* Shouldn't be `nullptr`. */
43 return systemPaths ? systemPaths->getUserSpecialDir(type) : nullptr;
44}
45
46const char *GHOST_getBinaryDir()
47{
48 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
49 /* Shouldn't be `nullptr`. */
50 return systemPaths ? systemPaths->getBinaryDir() : nullptr;
51}
52
53void GHOST_addToSystemRecentFiles(const char *filepath)
54{
55 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
56 if (systemPaths) {
57 systemPaths->addToSystemRecentFiles(filepath);
58 }
59}
const char * GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type)
void GHOST_addToSystemRecentFiles(const char *filepath)
const char * GHOST_getSystemDir(int version, const char *versionstr)
GHOST_TSuccess GHOST_DisposeSystemPaths()
GHOST_TSuccess GHOST_CreateSystemPaths()
const char * GHOST_getBinaryDir()
const char * GHOST_getUserDir(int version, const char *versionstr)
GHOST_TSuccess
Definition GHOST_Types.h:87
GHOST_TUserSpecialDirTypes
virtual const char * getSystemDir(int version, const char *versionstr) const =0
virtual const char * getUserDir(int version, const char *versionstr) const =0
static GHOST_TSuccess create()
static GHOST_TSuccess dispose()
static GHOST_ISystemPaths * get()
virtual const char * getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const =0
virtual void addToSystemRecentFiles(const char *filepath) const =0
virtual const char * getBinaryDir() const =0