Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreFiles.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_FILE_MANIP__
8#define __HDI_CORE_FILE_MANIP__
9
10#include <vector>
11
12#include "hdicoreTypes.h"
13
14namespace hdi
15{
16 namespace core
17 {
21 namespace files
22 {
23 typedef std::vector<std::string> StringVector;
24
33 bool exists(const std::string& filePath_);
34
35 #if defined(HDI_CORE_AIP_MODE)
44 bool onNetwork(const std::string& filePath_);
45 #endif
46
59 bool copy(const std::string& filePath_, const std::string& destPath_);
60
72 bool rename(const std::string& filePath_, const std::string& newName_);
73
85 bool move(const std::string& fromFilePath_, const std::string& toFolderPath_);
86
95 int64_t getSize(const std::string& filePath_);
96
107 std::string getTextContents(const std::string& filePath_);
108
123 bool setTextContents(const std::string& filePath_, const std::string& contents_);
124
137 bool getPermissions(const std::string& filePath_, mode_t& perms__);
138
155 bool makeDirectory(const std::string& path_, const mode_t perms_);
156
166 bool filesInDirectory(const std::string& path_, StringVector& files__);
167
176 bool moveToTrash(const std::string& filePath_);
177
190 bool ungzip(const std::string& sourcePath_, const std::string& destPath_);
191
205 std::string platformPrefsPath(const std::string& subfolder_, const bool create_ = true);
206 }
207 }
208}
209
210#endif
211// __HDI_CORE_FILE_MANIP__
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.