2018-10-28 07:54:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-12-03 23:27:16 +00:00
|
|
|
#include "AKString.h"
|
2018-10-28 07:54:20 +00:00
|
|
|
|
|
|
|
namespace AK {
|
|
|
|
|
|
|
|
class FileSystemPath {
|
|
|
|
public:
|
2019-05-28 09:53:16 +00:00
|
|
|
FileSystemPath() {}
|
2019-06-02 10:26:28 +00:00
|
|
|
explicit FileSystemPath(const StringView&);
|
2018-10-28 07:54:20 +00:00
|
|
|
|
2018-12-03 00:38:22 +00:00
|
|
|
bool is_valid() const { return m_is_valid; }
|
2019-06-07 18:58:12 +00:00
|
|
|
const String& string() const { return m_string; }
|
2018-10-28 07:54:20 +00:00
|
|
|
|
2019-06-07 18:58:12 +00:00
|
|
|
const String& basename() const { return m_basename; }
|
2018-11-18 13:57:41 +00:00
|
|
|
|
2019-03-30 02:27:25 +00:00
|
|
|
const Vector<String>& parts() const { return m_parts; }
|
|
|
|
|
2019-05-26 20:33:30 +00:00
|
|
|
bool has_extension(StringView) const;
|
|
|
|
|
2018-10-28 07:54:20 +00:00
|
|
|
private:
|
2018-12-03 00:38:22 +00:00
|
|
|
bool canonicalize(bool resolve_symbolic_links = false);
|
2018-10-28 07:54:20 +00:00
|
|
|
|
2019-03-30 02:27:25 +00:00
|
|
|
Vector<String> m_parts;
|
2018-10-28 07:54:20 +00:00
|
|
|
String m_string;
|
2018-11-18 13:57:41 +00:00
|
|
|
String m_basename;
|
2018-12-03 00:38:22 +00:00
|
|
|
bool m_is_valid { false };
|
2018-10-28 07:54:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
using AK::FileSystemPath;
|