Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
|
Organizes all file-/folder-related functionality into one namespace for convenience. More...
Typedefs | |
typedef std::vector< std::string > | StringVector |
Functions | |
bool | exists (const std::string &filePath_) |
Checks for the existence of a file or folder. | |
bool | onNetwork (const std::string &filePath_) |
Gets whether the given file is stored on a network drive. | |
bool | copy (const std::string &filePath_, const std::string &destPath_) |
Copies a source file to a destination path. | |
bool | rename (const std::string &filePath_, const std::string &newName_) |
Renames a file. | |
bool | move (const std::string &fromFilePath_, const std::string &toFolderPath_) |
Moves a file from one location to another. | |
int64_t | getSize (const std::string &filePath_) |
Returns the size of a file in bytes. | |
std::string | getTextContents (const std::string &filePath_) |
Gets the contents of a text-based file, assumed to be in UTF-8 encoding. | |
bool | setTextContents (const std::string &filePath_, const std::string &contents_) |
Sets the contents of a text-based file in UTF-8 encoding. | |
bool | getPermissions (const std::string &filePath_, mode_t &perms__) |
Gets the permission bits of a file or folder. | |
bool | makeDirectory (const std::string &path_, const mode_t perms_) |
Cross-platform function to create a directory at a given path with given permissions. | |
bool | filesInDirectory (const std::string &path_, StringVector &files__) |
Cross-platform function to retrieve the names of every file in a given directory. | |
bool | moveToTrash (const std::string &filePath_) |
Moves a file to the Trash (Mac) or Recycle Bin (Windows) | |
bool | ungzip (const std::string &sourcePath_, const std::string &destPath_) |
Un-gzips a source file to a destination path. | |
std::string | platformPrefsPath (const std::string &subfolder_, const bool create_=true) |
Gets the prefs/registration/etc. folder path (given a subfolder inside it) | |
Organizes all file-/folder-related functionality into one namespace for convenience.
bool hdi::core::files::copy | ( | const std::string & | filePath_, |
const std::string & | destPath_ | ||
) |
Copies a source file to a destination path.
filePath_ | Source file to copy, as UTF-8 |
destPath_ | Destination file, as UTF-8, into which the source file will be written |
bool hdi::core::files::exists | ( | const std::string & | filePath_ | ) |
Checks for the existence of a file or folder.
filePath_ | Path for the file whose existence is in question, as UTF-8 |
bool hdi::core::files::filesInDirectory | ( | const std::string & | path_, |
StringVector & | files__ | ||
) |
Cross-platform function to retrieve the names of every file in a given directory.
path_ | Path to directory whose file contents will be read, as UTF-8 |
files_ | Return-by-reference for a vector of all file names in the given directory, as UTF-8 |
bool hdi::core::files::getPermissions | ( | const std::string & | filePath_, |
mode_t & | perms__ | ||
) |
Gets the permission bits of a file or folder.
filePath_ | Path for the file whose permissions are in question, as UTF-8 |
perms__ | Return-by-reference for bitwise OR of permissions (0 by default) |
int64_t hdi::core::files::getSize | ( | const std::string & | filePath_ | ) |
Returns the size of a file in bytes.
filePath_ | Path for the file whose size is in question, as UTF-8 |
std::string hdi::core::files::getTextContents | ( | const std::string & | filePath_ | ) |
Gets the contents of a text-based file, assumed to be in UTF-8 encoding.
filePath_ | Path for the file whose contents are in question, as UTF-8 |
bool hdi::core::files::makeDirectory | ( | const std::string & | path_, |
const mode_t | perms_ | ||
) |
Cross-platform function to create a directory at a given path with given permissions.
path_ | Location at which the directory will be created, as UTF-8 |
perms_ | UNIX-style permissions for the file (e.g. octal 0755 means user rwx, group r-x, others r-x) |
bool hdi::core::files::move | ( | const std::string & | fromFilePath_, |
const std::string & | toFolderPath_ | ||
) |
Moves a file from one location to another.
fromFilePath_ | Absolute path to the file that should be moved, as UTF-8 |
toFolderPath_ | Absolute path to the destination folder, as UTF-8 |
bool hdi::core::files::moveToTrash | ( | const std::string & | filePath_ | ) |
Moves a file to the Trash (Mac) or Recycle Bin (Windows)
filePath_ | Absolute path to the file that should be deleted, as UTF-8 |
bool hdi::core::files::onNetwork | ( | const std::string & | filePath_ | ) |
Gets whether the given file is stored on a network drive.
filePath_ | Absolute path to the file in question |
std::string hdi::core::files::platformPrefsPath | ( | const std::string & | subfolder_, |
const bool | create_ = true |
||
) |
Gets the prefs/registration/etc. folder path (given a subfolder inside it)
subfolder_ | Your containing prefs subfolder inside the platform prefs path, as UTF-8 |
create_ | true to create the folder if it's missing, false to simply return the path |
bool hdi::core::files::rename | ( | const std::string & | filePath_, |
const std::string & | newName_ | ||
) |
Renames a file.
filePath_ | Absolute path to the file that should be renamed, as UTF-8 |
newName_ | New name for the file, as UTF-8 |
bool hdi::core::files::setTextContents | ( | const std::string & | filePath_, |
const std::string & | contents_ | ||
) |
Sets the contents of a text-based file in UTF-8 encoding.
filePath_ | Path for the file whose contents are to be set, as UTF-8 |
contents_ | Contents with which to overwrite the file, as UTF-8 |
bool hdi::core::files::ungzip | ( | const std::string & | sourcePath_, |
const std::string & | destPath_ | ||
) |
Un-gzips a source file to a destination path.
sourcePath_ | Absolute path to the file that should be un-gzipped, as UTF-8 |
destPath_ | Absolute path to the file that should be created from the gzipped file, as UTF-8 |