mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
73fdbba59c
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
39 lines
830 B
C++
39 lines
830 B
C++
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
|
|
namespace AK {
|
|
|
|
class FileSystemPath {
|
|
public:
|
|
FileSystemPath() {}
|
|
explicit FileSystemPath(const StringView&);
|
|
|
|
bool is_valid() const { return m_is_valid; }
|
|
const String& string() const { return m_string; }
|
|
|
|
const String& basename() const { return m_basename; }
|
|
const String& title() const { return m_title; }
|
|
const String& extension() const { return m_extension; }
|
|
|
|
const Vector<String>& parts() const { return m_parts; }
|
|
|
|
bool has_extension(StringView) const;
|
|
|
|
private:
|
|
void canonicalize();
|
|
|
|
Vector<String> m_parts;
|
|
String m_string;
|
|
String m_basename;
|
|
String m_title;
|
|
String m_extension;
|
|
bool m_is_valid { false };
|
|
};
|
|
|
|
String canonicalized_path(const StringView&);
|
|
|
|
};
|
|
|
|
using AK::canonicalized_path;
|
|
using AK::FileSystemPath;
|