MeVisLab Toolbox Reference
macos::FileManager Class Reference

File operations. More...

#include <macFileManager.h>

Public Types

enum  FMFolderType {
  LocalApplicationSupportFolder = 0x000 , LocalPreferencesFolderType , LocalCachesFolderType , UserDocumentsFolder = 0x100 ,
  UserDesktopFolder , UserDownloadsFolder , UserApplicationSupportFolder , UserPreferencesFolderType ,
  UserCachesFolderType
}
 Specifies the different folder types. More...
 

Static Public Member Functions

static std::string locateFolder (FMFolderType type)
 Obtains location information for system-related directories (UTF8) More...
 
static std::string getUserTemporaryItemsFolder ()
 Returns the path of the temporary directory for the current user (UTF8) More...
 
static bool isFilePackageAtPath (const std::string &path)
 Determines whether the specified path points to a file package (UTF8) More...
 
static bool moveItemToTrash (const std::string &file, bool hidden=true)
 The item is moved to the trash folder on the volume containing the item. Returns 'true' if successful (UTF8) More...
 
static bool authorizeAndCopyItem (const std::string &src, const std::string &dst)
 Request authorization to elevate privileges and copy item (UTF8, macOS 10.14) More...
 
static bool authorizeAndInstallItem (const std::string &src, const std::string &dst)
 Request authorization to elevate privileges and install item (UTF8) More...
 
static bool showItemInFileSystemBrowser (const std::string &file)
 Activates the Finder and opens one window selecting the specified item. More...
 
static std::string getItemUTI (const std::string &path)
 Returns the Uniform Type Identifier (UTI) of this filesystem item or an empty string (UTF8) More...
 
static bool itemConformsToUTI (const std::string &path, const std::string &uti)
 Returns 'true' if the given filesystem item conforms to the specified Uniform Type Identifier (UTI) More...
 

Detailed Description

File operations.

Definition at line 26 of file macFileManager.h.

Member Enumeration Documentation

◆ FMFolderType

Specifies the different folder types.

Enumerator
LocalApplicationSupportFolder 

Specifies the Application Support folder. This folder contains code and data files needed by third-party applications.

LocalPreferencesFolderType 

Specifies the Preferences folder.

LocalCachesFolderType 

Specifies the Caches folder (location of discardable cache files)

UserDocumentsFolder 

Specifies the Documents folder.

UserDesktopFolder 

Specifies the Desktop folder.

UserDownloadsFolder 

Specifies the Downloads folder.

UserApplicationSupportFolder 

Specifies the Application Support folder. This folder contains code and data files needed by third-party applications.

UserPreferencesFolderType 

Specifies the Preferences folder.

UserCachesFolderType 

Specifies the Caches folder (location of discardable cache files)

Definition at line 31 of file macFileManager.h.

Member Function Documentation

◆ authorizeAndCopyItem()

static bool macos::FileManager::authorizeAndCopyItem ( const std::string &  src,
const std::string &  dst 
)
static

Request authorization to elevate privileges and copy item (UTF8, macOS 10.14)

dst is the full name of the target file. The destination folder must exist

◆ authorizeAndInstallItem()

static bool macos::FileManager::authorizeAndInstallItem ( const std::string &  src,
const std::string &  dst 
)
static

Request authorization to elevate privileges and install item (UTF8)

dst is the full name of the target file. If the destination folder does not exist it is created

◆ getItemUTI()

static std::string macos::FileManager::getItemUTI ( const std::string &  path)
static

Returns the Uniform Type Identifier (UTI) of this filesystem item or an empty string (UTF8)

◆ getUserTemporaryItemsFolder()

static std::string macos::FileManager::getUserTemporaryItemsFolder ( )
static

Returns the path of the temporary directory for the current user (UTF8)

◆ isFilePackageAtPath()

static bool macos::FileManager::isFilePackageAtPath ( const std::string &  path)
static

Determines whether the specified path points to a file package (UTF8)

◆ itemConformsToUTI()

static bool macos::FileManager::itemConformsToUTI ( const std::string &  path,
const std::string &  uti 
)
static

Returns 'true' if the given filesystem item conforms to the specified Uniform Type Identifier (UTI)

◆ locateFolder()

static std::string macos::FileManager::locateFolder ( FMFolderType  type)
static

Obtains location information for system-related directories (UTF8)

◆ moveItemToTrash()

static bool macos::FileManager::moveItemToTrash ( const std::string &  file,
bool  hidden = true 
)
static

The item is moved to the trash folder on the volume containing the item. Returns 'true' if successful (UTF8)

If hidden is false, the item is moved to the trash in the same manner as the Finder, possibly showing graphical feedback

◆ showItemInFileSystemBrowser()

static bool macos::FileManager::showItemInFileSystemBrowser ( const std::string &  file)
static

Activates the Finder and opens one window selecting the specified item.

If the item is a directory show the directory contents in Finder. Returns 'true' if successful (UTF8)


The documentation for this class was generated from the following file: