Blender  V3.3
Functions | Variables
storage_apple.mm File Reference
#import <Foundation/Foundation.h>
#include <string>
#include <sys/xattr.h>
#include "BLI_fileops.h"
#include "BLI_path_util.h"

Go to the source code of this file.

Functions

bool BLI_file_alias_target (const char *filepath, char r_targetpath[FILE_MAXDIR])
 
static bool find_attribute (const std::string &attributes, const char *search_attribute)
 
static bool test_onedrive_file_is_placeholder (const char *path)
 
static bool test_file_is_offline (const char *path)
 
eFileAttributes BLI_file_attributes (const char *path)
 
const char * BLI_expand_tilde (const char *path_with_tilde)
 

Variables

static const char * ONEDRIVE_RECALLONOPEN_ATTRIBUTE = "com.microsoft.OneDrive.RecallOnOpen"
 

Detailed Description

macOS specific implementations for storage.c.

Definition in file storage_apple.mm.

Function Documentation

◆ BLI_expand_tilde()

const char* BLI_expand_tilde ( const char *  path_with_tilde)

Definition at line 172 of file storage_apple.mm.

References FILE_MAX.

Referenced by BKE_appdir_folder_home(), and BKE_appdir_font_folder_default().

◆ BLI_file_alias_target()

bool BLI_file_alias_target ( const char *  filepath,
char  r_targetpath[FILE_MAXDIR] 
)
Parameters
r_targetpathBuffer for the target path an alias points to.
Returns
Whether the file at the input path is an alias.

Definition at line 26 of file storage_apple.mm.

References error(), FILE_MAXDIR, and options.

◆ BLI_file_attributes()

eFileAttributes BLI_file_attributes ( const char *  path)

◆ find_attribute()

static bool find_attribute ( const std::string &  attributes,
const char *  search_attribute 
)
static

Checks if the given string of listxattr() attributes contains a specific attribute.

Parameters
attributesa string of null-terminated listxattr() attributes.
search_attributethe attribute to search for.
Returns
'true' when the attribute is found, otherwise 'false'.

Definition at line 65 of file storage_apple.mm.

References STREQ.

Referenced by test_onedrive_file_is_placeholder().

◆ test_file_is_offline()

static bool test_file_is_offline ( const char *  path)
static

Checks if the file is marked as offline and not immediately available.

Parameters
paththe path of the file.
Returns
'true' when the file is a placeholder, otherwise 'false'.

Definition at line 113 of file storage_apple.mm.

References test_onedrive_file_is_placeholder().

Referenced by BLI_file_attributes().

◆ test_onedrive_file_is_placeholder()

static bool test_onedrive_file_is_placeholder ( const char *  path)
static

Checks if the file is merely a placeholder for a OneDrive file that hasn't yet been downloaded.

Parameters
paththe path of the file.
Returns
'true' when the file is a OneDrive placeholder, otherwise 'false'.

Definition at line 84 of file storage_apple.mm.

References find_attribute(), ONEDRIVE_RECALLONOPEN_ATTRIBUTE, and size().

Referenced by test_file_is_offline().

Variable Documentation

◆ ONEDRIVE_RECALLONOPEN_ATTRIBUTE

const char* ONEDRIVE_RECALLONOPEN_ATTRIBUTE = "com.microsoft.OneDrive.RecallOnOpen"
static

Definition at line 18 of file storage_apple.mm.

Referenced by test_onedrive_file_is_placeholder().