From 34871eb231f69d46a594b5184b8aba5abbf4d6a6 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 16 Dec 2004 21:14:46 +0000 Subject: Added isValidPath() in fileSystemFactory. --- src/utility/file.hpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/utility') diff --git a/src/utility/file.hpp b/src/utility/file.hpp index 1f92696b..5dc7d01d 100644 --- a/src/utility/file.hpp +++ b/src/utility/file.hpp @@ -204,21 +204,37 @@ public: * @param path full path (absolute) of the file * @return new file object for the path */ - virtual file* create(const file::path& path) = 0; + virtual file* create(const file::path& path) const = 0; /** Parse a path contained in a string. * * @param str string containing a path in a system-dependant representation * @return path object (abstract representation) */ - virtual file::path stringToPath(const string& str) = 0; + virtual const file::path stringToPath(const string& str) const = 0; /** Return the system-dependant string representation for the specified path. * * @param path abstract representation of the path * @return string representation of the path */ - virtual string pathToString(const file::path& path) = 0; + virtual const string pathToString(const file::path& path) const = 0; + + /** Test whether the specified path component is syntactically + * valid (ie: does not contain any 'special' character). + * + * @param comp path component to test + * @return true if the component is valid, false otherwise + */ + virtual const bool isValidPathComponent(const file::path::component& comp) const = 0; + + /** Test whether the specified path is syntactically valid + * (ie: components do not contain any 'special' character). + * + * @param path path to test + * @return true if the path is valid, false otherwise + */ + virtual const bool isValidPath(const file::path& path) const = 0; }; -- cgit