Files
test2/intern/ghost/intern/GHOST_Path-api.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.5 KiB
C++
Raw Normal View History

/* SPDX-FileCopyrightText: 2010 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
2011-02-25 11:28:33 +00:00
/** \file
* \ingroup GHOST
2011-02-25 11:28:33 +00:00
*/
2013-03-08 09:09:48 +00:00
#include <cstdio>
#include "GHOST_ISystemPaths.hh"
#include "GHOST_Path-api.hh"
#include "GHOST_Types.h"
#include "intern/GHOST_Debug.hh"
GHOST_TSuccess GHOST_CreateSystemPaths()
{
2011-08-31 01:07:55 +00:00
return GHOST_ISystemPaths::create();
}
GHOST_TSuccess GHOST_DisposeSystemPaths()
{
return GHOST_ISystemPaths::dispose();
}
const char *GHOST_getSystemDir(int version, const char *versionstr)
{
const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getSystemDir(version, versionstr) : nullptr;
}
const char *GHOST_getUserDir(int version, const char *versionstr)
{
const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
/* Shouldn't be `nullptr`. */
return systemPaths ? systemPaths->getUserDir(version, versionstr) : nullptr;
}
const char *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type)
{
const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
/* Shouldn't be `nullptr`. */
return systemPaths ? systemPaths->getUserSpecialDir(type) : nullptr;
}
const char *GHOST_getBinaryDir()
{
const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
/* Shouldn't be `nullptr`. */
return systemPaths ? systemPaths->getBinaryDir() : nullptr;
2010-07-04 21:33:01 +00:00
}
2022-08-12 11:14:31 +10:00
void GHOST_addToSystemRecentFiles(const char *filepath)
{
const GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
if (systemPaths) {
2022-08-12 11:14:31 +10:00
systemPaths->addToSystemRecentFiles(filepath);
}
2011-01-05 19:19:49 +00:00
}