diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-28 08:54:20 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-28 08:54:20 +0100 |
commit | 88ad59bfb18feead399c5250b426fc3dc3512b95 (patch) | |
tree | d535ca41ef6b24d5554a24efbf39415b39c4861f /AK/FileSystemPath.h | |
parent | 43475f248be4798b3400c14e0a019fcbc809e6db (diff) | |
download | serenity-88ad59bfb18feead399c5250b426fc3dc3512b95.zip |
Add a simple FileSystemPath class that can canonicalize paths.
Also a simple StringBuilder to help him out.
Diffstat (limited to 'AK/FileSystemPath.h')
-rw-r--r-- | AK/FileSystemPath.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/AK/FileSystemPath.h b/AK/FileSystemPath.h new file mode 100644 index 0000000000..46c9e694c5 --- /dev/null +++ b/AK/FileSystemPath.h @@ -0,0 +1,24 @@ +#pragma once + +#include "String.h" + +namespace AK { + +class FileSystemPath { +public: + FileSystemPath() { } + explicit FileSystemPath(const String&); + + bool isValid() const { return m_isValid; } + String string() const { return m_string; } + +private: + bool canonicalize(bool resolveSymbolicLinks = false); + + String m_string; + bool m_isValid { false }; +}; + +}; + +using AK::FileSystemPath; |