diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2018-07-19 03:07:11 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-07-19 03:07:11 +0200 |
commit | 29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef (patch) | |
tree | 3202e2ce55ab6387a4ca366a509eccdd963434c3 /src/core/file_sys/path_parser.h | |
parent | Merge pull request #683 from DarkLordZach/touch (diff) | |
download | yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.gz yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.bz2 yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.lz yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.xz yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.zst yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/path_parser.h | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/core/file_sys/path_parser.h b/src/core/file_sys/path_parser.h deleted file mode 100644 index 184f59d55..000000000 --- a/src/core/file_sys/path_parser.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2016 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <string> -#include <vector> -#include "core/file_sys/filesystem.h" - -namespace FileSys { - -/** - * A helper class parsing and verifying a string-type Path. - * Every archives with a sub file system should use this class to parse the path argument and check - * the status of the file / directory in question on the host file system. - */ -class PathParser { -public: - explicit PathParser(const Path& path); - - /** - * Checks if the Path is valid. - * This function should be called once a PathParser is constructed. - * A Path is valid if: - * - it is a string path (with type LowPathType::Char or LowPathType::Wchar), - * - it starts with "/" (this seems a hard requirement in real 3DS), - * - it doesn't contain invalid characters, and - * - it doesn't go out of the root directory using "..". - */ - bool IsValid() const { - return is_valid; - } - - /// Checks if the Path represents the root directory. - bool IsRootDirectory() const { - return is_root; - } - - enum HostStatus { - InvalidMountPoint, - PathNotFound, // "/a/b/c" when "a" doesn't exist - FileInPath, // "/a/b/c" when "a" is a file - FileFound, // "/a/b/c" when "c" is a file - DirectoryFound, // "/a/b/c" when "c" is a directory - NotFound // "/a/b/c" when "a/b/" exists but "c" doesn't exist - }; - - /// Checks the status of the specified file / directory by the Path on the host file system. - HostStatus GetHostStatus(const std::string& mount_point) const; - - /// Builds a full path on the host file system. - std::string BuildHostPath(const std::string& mount_point) const; - -private: - std::vector<std::string> path_sequence; - bool is_valid{}; - bool is_root{}; -}; - -} // namespace FileSys |