Blender V5.3
GHOST_ISystemPaths.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <optional>
12#include <string>
13
14#include "GHOST_Types.hh"
15
17 public:
22 static GHOST_TSuccess create();
23
28 static GHOST_TSuccess dispose();
29
34 static GHOST_ISystemPaths *get();
35
36 protected:
42
47 virtual ~GHOST_ISystemPaths() = default;
48
49 public:
55 virtual const char *getSystemDir(int version, const char *versionstr) const = 0;
56
67 virtual const char *getSystemLibsDir(int /*version*/, const char * /*versionstr*/) const
68 {
69 return nullptr;
70 }
71
77 virtual const char *getUserDir(int version, const char *versionstr) const = 0;
78
83 virtual std::optional<std::string> getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const = 0;
84
89 virtual const char *getBinaryDir() const = 0;
90
94 virtual void addToSystemRecentFiles(const char *filepath) const = 0;
95
96 private:
98 static GHOST_ISystemPaths *system_paths_;
99
100 MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_ISystemPaths")
101};
GHOST_TSuccess
GHOST_TUserSpecialDirTypes
virtual const char * getSystemDir(int version, const char *versionstr) const =0
virtual const char * getSystemLibsDir(int, const char *) const
virtual const char * getUserDir(int version, const char *versionstr) const =0
static GHOST_TSuccess create()
static GHOST_TSuccess dispose()
static GHOST_ISystemPaths * get()
virtual ~GHOST_ISystemPaths()=default
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