lfilesystem  0.0.1
C++ filesystem library
lfilesystem_Paths.h
Go to the documentation of this file.
1 /*
2  * ======================================================================================
3  * __ ____ __ __ ____ ___
4  * ( ) (_ _)( \/ )( ___)/ __)
5  * )(__ _)(_ ) ( )__) \__ \
6  * (____)(____)(_/\/\_)(____)(___/
7  *
8  * This file is part of the Limes open source library and is licensed under the terms of the GNU Public License.
9  *
10  * Commercial licenses are available; contact the maintainers at ben.the.vining@gmail.com to inquire for details.
11  *
12  * ======================================================================================
13  */
14 
15 #pragma once
16 
17 #include <filesystem>
18 #include "lfilesystem/lfilesystem_Export.h"
19 
25 namespace limes::files
26 {
27 
28 using Path = std::filesystem::path;
29 
37 [[nodiscard]] LFILE_EXPORT bool isValidPath (const Path& path);
38 
54 [[nodiscard]] LFILE_EXPORT Path normalizePath (const Path& path);
55 
64 [[nodiscard]] LFILE_EXPORT Path largestCommonPrefix (const Path& path1, const Path& path2);
65 
66 } // namespace limes::files
LFILE_EXPORT Path largestCommonPrefix(const Path &path1, const Path &path2)
Returns the largest prefix path fragment common to path1 and path2 .
LFILE_EXPORT Path normalizePath(const Path &path)
This function takes an input path and does some linting and transformations to create a consistent,...
LFILE_EXPORT bool isValidPath(const Path &path)
Tests whether the passed path contains any invalid characters or character sequences,...
std::filesystem::path Path
Convenience typedef for filesystem paths.
Filesystem utilities.