Blender V5.0
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
8
9#include "GHOST_Path-api.hh"
10#include "GHOST_ISystemPaths.hh"
11#include "GHOST_Types.h"
12#include "intern/GHOST_Debug.hh"
13
18
23
24const char *GHOST_getSystemDir(int version, const char *versionstr)
25{
26 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
27 return systemPaths ? systemPaths->getSystemDir(version, versionstr) : nullptr;
28}
29
30const char *GHOST_getUserDir(int version, const char *versionstr)
31{
32 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
33 /* Shouldn't be `nullptr`. */
34 return systemPaths ? systemPaths->getUserDir(version, versionstr) : nullptr;
35}
36
38{
39 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
40 /* Shouldn't be `nullptr`. */
41 return systemPaths ? systemPaths->getUserSpecialDir(type) : nullptr;
42}
43
44const char *GHOST_getBinaryDir()
45{
46 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
47 /* Shouldn't be `nullptr`. */
48 return systemPaths ? systemPaths->getBinaryDir() : nullptr;
49}
50
51void GHOST_addToSystemRecentFiles(const char *filepath)
52{
53 const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
54 if (systemPaths) {
55 systemPaths->addToSystemRecentFiles(filepath);
56 }
57}
std::optional< std::string > 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:57
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 void addToSystemRecentFiles(const char *filepath) const =0
virtual const char * getBinaryDir() const =0
virtual std::optional< std::string > getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const =0