Blender V5.3
BKE_appdir.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
12
13#include <cstddef>
14
15#include <optional>
16#include <string>
17
18#include "BLI_compiler_attrs.hh"
19#include "BLI_string_ref.hh"
20
21#include "DNA_listBase.h"
22
23namespace blender {
24
34void BKE_appdir_init();
35void BKE_appdir_exit();
36
70void BKE_appdir_folder_caches(char *path, size_t path_maxncpy) ATTR_NONNULL(1);
71
79bool BKE_appdir_folder_id_ex(int folder_id,
80 const char *subfolder,
81 char *path,
82 size_t path_maxncpy);
83std::optional<std::string> BKE_appdir_folder_id(int folder_id,
84 const char *subfolder) ATTR_WARN_UNUSED_RESULT;
88std::optional<std::string> BKE_appdir_folder_id_create(int folder_id, const char *subfolder)
93std::optional<std::string> BKE_appdir_folder_id_user_notest(int folder_id, const char *subfolder)
99std::optional<std::string> BKE_appdir_resource_path_id_with_version(int folder_id,
100 bool check_is_dir,
101 int version);
102std::optional<std::string> BKE_appdir_resource_path_id(int folder_id, bool check_is_dir);
103
108bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_maxncpy)
109 ATTR_NONNULL(1);
110bool BKE_appdir_app_template_has_userpref(const char *app_template) ATTR_NONNULL(1);
111void BKE_appdir_app_templates(ListBaseT<LinkData> *templates) ATTR_NONNULL(1);
112
116void BKE_appdir_program_path_init(const char *argv0) ATTR_NONNULL(1);
117
126
130bool BKE_appdir_font_folder_default(char *dir, size_t dir_maxncpy);
131
135bool BKE_appdir_program_python_search(char *program_filepath,
136 size_t program_filepath_maxncpy,
137 int version_major,
138 int version_minor) ATTR_NONNULL(1);
139
143void BKE_tempdir_init(const char *userdir);
144
157
163enum {
164 /* general, will find based on user/local/system priority */
166
167 /* user-specific */
172
173 /* system */
178};
179
181enum {
194};
195
196#define BLENDER_STARTUP_FILE "startup.blend"
197#define BLENDER_USERPREF_FILE "userpref.blend"
198#define BLENDER_QUIT_FILE "quit.blend"
199#define BLENDER_BOOKMARK_FILE "bookmarks.txt"
200#define BLENDER_HISTORY_FILE "recent-files.txt"
201#define BLENDER_RECENT_SEARCHES_FILE "recent-searches.txt"
202#define BLENDER_PLATFORM_SUPPORT_FILE "platform_support.txt"
203#define BLENDER_RECENTS_FILE "recents.toml"
204
205} // namespace blender
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
Object ATTR_RETURNS_NONNULL
const char * BKE_appdir_program_dir() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1009
void BKE_appdir_app_templates(ListBaseT< LinkData > *templates) ATTR_NONNULL(1)
Definition appdir.cc:1161
void BKE_tempdir_session_purge()
Definition appdir.cc:1293
bool BKE_appdir_folder_id_ex(int folder_id, const char *subfolder, char *path, size_t path_maxncpy)
Definition appdir.cc:649
const char * BKE_appdir_folder_default_or_root() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:165
std::optional< std::string > BKE_appdir_folder_id_create(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
Definition appdir.cc:822
void BKE_appdir_init()
Definition appdir.cc:95
bool BKE_appdir_app_template_any()
Definition appdir.cc:1122
@ BLENDER_RESOURCE_PATH_SYSTEM_LIBS
@ BLENDER_RESOURCE_PATH_SYSTEM
@ BLENDER_RESOURCE_PATH_USER
@ BLENDER_RESOURCE_PATH_LOCAL
const char * BKE_tempdir_session() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1283
std::optional< std::string > BKE_appdir_folder_id(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
Definition appdir.cc:762
const char * BKE_appdir_folder_root() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:154
bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_maxncpy) ATTR_NONNULL(1)
Definition appdir.cc:1127
bool BKE_appdir_app_template_has_userpref(const char *app_template) ATTR_NONNULL(1)
Definition appdir.cc:1141
bool BKE_appdir_program_python_search(char *program_filepath, size_t program_filepath_maxncpy, int version_major, int version_minor) ATTR_NONNULL(1)
Definition appdir.cc:1015
bool BKE_appdir_folder_documents(char *dir) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
Definition appdir.cc:174
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1288
std::optional< std::string > BKE_appdir_resource_path_id(int folder_id, bool check_is_dir)
Definition appdir.cc:878
std::optional< std::string > BKE_appdir_folder_id_user_notest(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
Definition appdir.cc:771
void BKE_appdir_program_path_init(const char *argv0) ATTR_NONNULL(1)
Definition appdir.cc:978
void BKE_appdir_folder_caches(char *path, size_t path_maxncpy) ATTR_NONNULL(1)
Definition appdir.cc:206
std::optional< std::string > BKE_appdir_resource_path_id_with_version(int folder_id, bool check_is_dir, int version)
Definition appdir.cc:847
bool BKE_appdir_font_folder_default(char *dir, size_t dir_maxncpy)
Definition appdir.cc:234
const char * BKE_appdir_program_path() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1001
bool ATTR_WARN_UNUSED_RESULT
void ATTR_NONNULL(1, 2)
@ BLENDER_SYSTEM_EXTENSIONS
@ BLENDER_USER_EXTENSIONS
@ BLENDER_USER_CONFIG
@ BLENDER_SYSTEM_PYTHON
@ BLENDER_SYSTEM_DATAFILES
@ BLENDER_USER_DATAFILES
@ BLENDER_DATAFILES
@ BLENDER_SYSTEM_SCRIPTS
@ BLENDER_USER_SCRIPTS
void BKE_appdir_exit()
Definition appdir.cc:103
void BKE_tempdir_init(const char *userdir)
Definition appdir.cc:1245
const char * BKE_appdir_folder_default() ATTR_WARN_UNUSED_RESULT
Definition appdir.cc:139