bool read : 1;
bool write : 1;
};
- typedef Permissions (*PermissonChecker)(const SGPath&);
+ typedef Permissions (*PermissionChecker)(const SGPath&);
/** Default constructor */
- explicit SGPath(PermissonChecker validator = NULL);
+ explicit SGPath(PermissionChecker validator = NULL);
/** Copy contructor */
SGPath(const SGPath& p);
* Construct a path based on the starting path provided.
* @param p initial path
*/
- SGPath( const std::string& p, PermissonChecker validator = NULL );
+ SGPath( const std::string& p, PermissionChecker validator = NULL );
/**
* Construct a path based on the starting path provided and a relative subpath
*/
SGPath( const SGPath& p,
const std::string& r,
- PermissonChecker validator = NULL );
+ PermissionChecker validator = NULL );
/** Destructor */
~SGPath();
bool operator==(const SGPath& other) const;
bool operator!=(const SGPath& other) const;
- void setPermissonChecker(PermissonChecker validator);
- PermissonChecker getPermissonChecker() const;
+ void setPermissionChecker(PermissionChecker validator);
+ PermissionChecker getPermissionChecker() const;
/**
* Set if file information (exists, type, mod-time) is cached or
*/
bool rename(const SGPath& newName);
+ enum StandardLocation
+ {
+ HOME,
+ DESKTOP,
+ DOWNLOADS,
+ DOCUMENTS,
+ PICTURES
+ };
+
+ static SGPath standardLocation( StandardLocation type,
+ const SGPath& def = SGPath() );
+
/**
* Get a path stored in the environment variable with the given \a name.
*
* Get path to the user's documents directory
*/
static SGPath documents(const SGPath& def = SGPath());
+
private:
void fix();
void checkAccess() const;
std::string path;
- PermissonChecker _permission_checker;
+ PermissionChecker _permission_checker;
mutable bool _cached : 1;
mutable bool _rwCached : 1;