7#ifndef __HDI_CORE_FILE_MANIP__
8#define __HDI_CORE_FILE_MANIP__
23 typedef std::vector<std::string> StringVector;
33 bool exists(
const std::string& filePath_);
35 #if defined(HDI_CORE_AIP_MODE)
59 bool copy(
const std::string& filePath_,
const std::string& destPath_);
72 bool rename(
const std::string& filePath_,
const std::string& newName_);
85 bool move(
const std::string& fromFilePath_,
const std::string& toFolderPath_);
95 int64_t
getSize(
const std::string& filePath_);
190 bool ungzip(
const std::string& sourcePath_,
const std::string& destPath_);
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
std::string platformPrefsPath(const std::string &subfolder_, const bool create_=true)
Gets the prefs/registration/etc. folder path (given a subfolder inside it)
bool filesInDirectory(const std::string &path_, StringVector &files__)
Cross-platform function to retrieve the names of every file in a given directory.
bool rename(const std::string &filePath_, const std::string &newName_)
Renames a file.
bool getPermissions(const std::string &filePath_, mode_t &perms__)
Gets the permission bits of a file or folder.
bool moveToTrash(const std::string &filePath_)
Moves a file to the Trash (Mac) or Recycle Bin (Windows)
bool move(const std::string &fromFilePath_, const std::string &toFolderPath_)
Moves a file from one location to another.
bool onNetwork(const std::string &filePath_)
Gets whether the given file is stored on a network drive.
bool exists(const std::string &filePath_)
Checks for the existence of a file or folder.
int64_t getSize(const std::string &filePath_)
Returns the size of a file in bytes.
bool ungzip(const std::string &sourcePath_, const std::string &destPath_)
Un-gzips a source file to a destination path.
bool setTextContents(const std::string &filePath_, const std::string &contents_)
Sets the contents of a text-based file in UTF-8 encoding.
std::string getTextContents(const std::string &filePath_)
Gets the contents of a text-based file, assumed to be in UTF-8 encoding.
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 copy(const std::string &filePath_, const std::string &destPath_)
Copies a source file to a destination path.