Blender V5.3
appdir.cc File Reference
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "BLI_fileops.hh"
#include "BLI_fileops_types.hh"
#include "BLI_listbase.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.hh"
#include "BLI_string_utils.hh"
#include "BLI_tempfile.hh"
#include "BLI_utildefines.hh"
#include "BLI_vector.hh"
#include "BKE_appdir.hh"
#include "BKE_blender_version.h"
#include "BLT_translation.hh"
#include "GHOST_ISystemPaths.hh"
#include "CLG_log.h"
#include <unistd.h>

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define STR_OR_FALLBACK(a)

Functions

bool blender::BKE_appdir_app_template_any ()
Internal Utilities
static char * blender::blender_version_decimal (const int version)
Default Directories
const char * blender::BKE_appdir_folder_default () ATTR_WARN_UNUSED_RESULT
const char * blender::BKE_appdir_folder_root () ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
const char * blender::BKE_appdir_folder_default_or_root () ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
bool blender::BKE_appdir_folder_documents (char *dir) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
void blender::BKE_appdir_folder_caches (char *path, size_t path_maxncpy) ATTR_NONNULL(1)
bool blender::BKE_appdir_font_folder_default (char *dir, size_t dir_maxncpy)
Path Presets (Internal Helpers)
static bool blender::test_path (char *targetpath, size_t targetpath_maxncpy, const bool check_is_dir, const char *path_base, const char *folder_name, const char *subfolder_name)
static bool blender::test_env_path (char *path, const char *envvar, const bool check_is_dir)
static bool blender::get_path_local_ex (char *targetpath, size_t targetpath_maxncpy, const char *folder_name, const char *subfolder_name, const int version, const bool check_is_dir)
static bool blender::get_path_local (char *targetpath, size_t targetpath_maxncpy, const char *folder_name, const char *subfolder_name)
static bool blender::get_path_environment_ex (char *targetpath, size_t targetpath_maxncpy, const char *subfolder_name, const char *envvar, const bool check_is_dir)
static bool blender::get_path_environment (char *targetpath, size_t targetpath_maxncpy, const char *subfolder_name, const char *envvar)
static Vector< std::string > blender::get_path_environment_multiple (const char *subfolder_name, const char *envvar, const bool check_is_dir)
static bool blender::get_path_user_ex (char *targetpath, size_t targetpath_maxncpy, const char *folder_name, const char *subfolder_name, const int version, const bool check_is_dir)
static bool blender::get_path_user (char *targetpath, size_t targetpath_maxncpy, const char *folder_name, const char *subfolder_name)
static bool blender::get_path_system_ex (char *targetpath, size_t targetpath_maxncpy, const char *folder_name, const char *subfolder_name, const int version, const bool check_is_dir)
static bool blender::get_path_system (char *targetpath, size_t targetpath_maxncpy, const char *folder_name, const char *subfolder_name)
static bool blender::get_path_system_libs_ex (char *targetpath, size_t targetpath_maxncpy, const char *folder_name, const char *subfolder_name, const int version, const bool check_is_dir)
Path Presets API
bool blender::BKE_appdir_folder_id_ex (int folder_id, const char *subfolder, char *path, size_t path_maxncpy)
std::optional< std::string > blender::BKE_appdir_folder_id (int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
std::optional< std::string > blender::BKE_appdir_folder_id_user_notest (int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
std::optional< std::string > blender::BKE_appdir_folder_id_create (int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
std::optional< std::string > blender::BKE_appdir_resource_path_id_with_version (int folder_id, bool check_is_dir, int version)
std::optional< std::string > blender::BKE_appdir_resource_path_id (int folder_id, bool check_is_dir)
Program Path Queries

Access locations of Blender & Python.

static void blender::where_am_i (char *program_filepath, const size_t program_filepath_maxncpy, const char *program_name)
void blender::BKE_appdir_program_path_init (const char *argv0) ATTR_NONNULL(1)
const char * blender::BKE_appdir_program_path () ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
const char * blender::BKE_appdir_program_dir () ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
bool blender::BKE_appdir_program_python_search (char *program_filepath, size_t program_filepath_maxncpy, int version_major, int version_minor) ATTR_NONNULL(1)
Application Templates
static Vector< std::string > blender::appdir_app_template_directories ()
bool blender::BKE_appdir_app_template_id_search (const char *app_template, char *path, size_t path_maxncpy) ATTR_NONNULL(1)
bool blender::BKE_appdir_app_template_has_userpref (const char *app_template) ATTR_NONNULL(1)
void blender::BKE_appdir_app_templates (ListBaseT< LinkData > *templates) ATTR_NONNULL(1)
Temporary Directories
static bool blender::where_is_temp (char *tempdir, const size_t tempdir_maxncpy, const char *userdir)
static bool blender::tempdir_session_create (char *tempdir_session, const size_t tempdir_session_maxncpy, const char *tempdir)
void blender::BKE_tempdir_init (const char *userdir)
const char * blender::BKE_tempdir_session () ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
const char * blender::BKE_tempdir_base () ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
void blender::BKE_tempdir_session_purge ()

Variables

static const char blender::_str_null [] = "(null)"
Local Variables
static CLG_LogRef blender::LOG = {"system.path"}
static struct  blender::g_app

Initialization

#define ASSERT_IS_INIT()
static bool blender::is_appdir_init = false
void blender::BKE_appdir_init ()
void blender::BKE_appdir_exit ()

Detailed Description

Access to application level directories.

Definition in file appdir.cc.

Macro Definition Documentation

◆ ASSERT_IS_INIT

#define ASSERT_IS_INIT ( )
Value:
BLI_assert(is_appdir_init)
#define BLI_assert(a)

Definition at line 90 of file appdir.cc.

Referenced by blender::BKE_appdir_program_python_search(), blender::test_env_path(), and blender::test_path().

◆ STR_OR_FALLBACK

#define STR_OR_FALLBACK ( a)
Value:
((a) ? (a) : _str_null)

Definition at line 57 of file appdir.cc.

Referenced by blender::get_path_local_ex(), blender::get_path_system_ex(), blender::get_path_system_libs_ex(), and blender::get_path_user_ex().