15 # include <boost/scoped_ptr.hpp>
18 namespace boost {
namespace filesystem {
38 Path(
const std::string& unicodePath = std::string());
41 Path(
const char* unicodePath);
47 Path(
const boost::filesystem::path& path);
62 bool isRegularFile()
const;
65 bool isSymlink()
const;
68 std::string filename()
const;
71 std::string extension()
const;
77 Path absolute()
const;
89 operator std::string()
const;
92 std::string str()
const;
95 const boost::filesystem::path& bfsPath()
const;
109 output << path.
str();
114 Path(PrivatePath* p);
115 boost::scoped_ptr<PrivatePath> _p;
145 void removeAll(
int retry);
233 QI_API std::string
findBin(
const std::string& name,
bool searchInPath=
false);
277 const std::string& filename);
305 const std::string& filename,
306 bool excludeUserWritablePath =
false);
341 QI_API std::vector<std::string>
listData(
const std::string& applicationName,
342 const std::string& pattern=
"*",
343 bool excludeUserWritablePath =
false);
347 QI_API std::vector<std::string>
listLib(
const std::string& subfolder,
348 const std::string& pattern=
"*");
362 QI_API std::vector<std::string>
confPaths(
const std::string& applicationName=
"");
385 QI_API std::vector<std::string>
dataPaths(
const std::string& applicationName=
"",
386 bool excludeUserWritablePath =
false);
434 const std::string& filename);
456 const std::string& filename=
"");
499 #endif // _QI_PATH_HPP_
std::string findBin(const std::string &name, bool searchInPath=false)
Look for a binary.
codecvt_type & unicodeFacet()
UTF-8 facet object getter.
void setWritablePath(const std::string &path)
Set the writable files path for users.
std::vector< std::string > getSdkPrefixes()
Return the SDK prefixes list. It's always complete, native paths.
void addOptionalSdkPrefix(const char *prefix)
Add a new SDK prefix to the list of searchable prefixes.
std::codecvt< wchar_t, char, std::mbstate_t > codecvt_type
Standard std::codecvt type accepted by STL and boost.
std::vector< std::string > confPaths(const std::string &applicationName="")
Get the list of directories used when searching for configuration files for the given application nam...
std::vector< std::string > listLib(const std::string &subfolder, const std::string &pattern="*")
QI_API_DEPRECATED void setWritablePath(const std::string &path)
Set the writable files path for users.
friend std::ostream & operator<<(std::ostream &output, const qi::Path &path)
Standard output stream operator for logging.
dll import/export and compiler message
std::string findConf(const std::string &applicationName, const std::string &filename)
Look for a configuration file.
std::string findLib(const std::string &name)
Look for a library.
std::vector< std::string > libPaths()
Get the list of directories used when searching for libraries.
std::string str() const
return the path as a string
std::vector< std::string > listData(const std::string &applicationName, const std::string &pattern="*", bool excludeUserWritablePath=false)
List data files matching the given pattern in all dataPaths(applicationName) directories. For each match, return the occurence from the first dataPaths prefix. Directories are discarded.
std::string convertToDosPath(const std::string &pathString)
Convert given path into DOS 8.3 path if it exists, else returns empty string (Windows only)...
std::vector< Path > PathVector
The Path class allow handling path in a cross-platform maner. <includename>qi/path.hpp</includename> The class assume that all string are encoded in UTF-8.
std::string userWritableDataPath(const std::string &applicationName, const std::string &filename)
Get the writable data files path for users.
std::vector< std::string > binPaths()
Get the list of directories used when searching for binaries.
std::string findData(const std::string &applicationName, const std::string &filename, bool excludeUserWritablePath=false)
Look for a file in all dataPaths(applicationName) directories, return the first match.
std::string sdkPrefix()
Return the default SDK prefix path.
std::string userWritableConfPath(const std::string &applicationName, const std::string &filename="")
Get the writable configuration files path for users.
std::vector< std::string > dataPaths(const std::string &applicationName="", bool excludeUserWritablePath=false)
Get the list of directories used when searching for data files for the given application name...
#define QI_API_DEPRECATED
Compiler flags to mark a function as deprecated. It will generate a compiler warning.
void clearOptionalSdkPrefix()
Reset the list of additional SDK prefixes.