Mercurial > code
changeset 578:67da1bacd884
Fs: reduce column limit
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 20 Jul 2016 16:26:55 +0200 |
parents | d0b9ce94b857 |
children | 8523c9300c4c |
files | modules/fs/fs.cpp modules/fs/fs.hpp |
diffstat | 2 files changed, 21 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/modules/fs/fs.cpp Wed Jul 20 16:17:55 2016 +0200 +++ b/modules/fs/fs.cpp Wed Jul 20 16:26:55 2016 +0200 @@ -78,7 +78,8 @@ * hasAccess. * ------------------------------------------------------------------ * - * Check if we have access to the file specified, mode is the same used as std::fopen. + * Check if we have access to the file specified, mode is the same used as + * std::fopen. */ bool hasAccess(const std::string &path, const std::string &mode) {
--- a/modules/fs/fs.hpp Wed Jul 20 16:17:55 2016 +0200 +++ b/modules/fs/fs.hpp Wed Jul 20 16:26:55 2016 +0200 @@ -32,12 +32,14 @@ * * The following options can be set by the user: * - * - **FS_HAVE_STAT**: (bool) Set to true if sys/stat.h and stat function are available, automatically detected. + * - **FS_HAVE_STAT**: (bool) Set to true if sys/stat.h and stat function are + * available, automatically detected. * * ## Export macros * - * You must define `FS_DLL` globally and `FS_BUILDING_DLL` when compiling the library if you want a DLL, alternatively you can provide - * your own `FS_EXPORT` macro instead. + * You must define `FS_DLL` globally and `FS_BUILDING_DLL` when compiling the + * library if you want a DLL, alternatively you can provide your own + * `FS_EXPORT` macro instead. */ /** @@ -200,7 +202,8 @@ /** * Check if a file exists. * - * If HAVE_ACCESS is defined, the function access is used, otherwise stat is used. + * If HAVE_ACCESS is defined, the function access is used, otherwise stat is + * used. * * \param path the path to check * \return true if the path exists @@ -289,7 +292,8 @@ /** * Remove a directory recursively. * - * If errors happens, they are silently discarded to remove as much as possible. + * If errors happens, they are silently discarded to remove as much as + * possible. * * \param path the path */ @@ -314,8 +318,10 @@ std::string findIf(const std::string &base, Predicate &&predicate) { /* - * Do not go deeply to the tree before testing all files in the current directory for performances reasons, we iterate - * this directory to search for the entry name and iterate again over all sub directories if not found. + * Do not go deeply to the tree before testing all files in the current + * directory for performances reasons, we iterate + * this directory to search for the entry name and iterate again over all + * sub directories if not found. */ std::string path; std::vector<Entry> entries = readdir(base); @@ -353,7 +359,9 @@ */ inline std::string find(const std::string &base, const std::string &name) { - return findIf(base, [&] (const auto &, const auto &entry) { return entry.name == name; }); + return findIf(base, [&] (const auto &, const auto &entry) { + return entry.name == name; + }); } /** @@ -366,7 +374,9 @@ */ inline std::string find(const std::string &base, const std::regex ®ex) { - return findIf(base, [&] (const auto &, const auto &entry) { return std::regex_match(entry.name, regex); }); + return findIf(base, [&] (const auto &, const auto &entry) { + return std::regex_match(entry.name, regex); + }); } /**