mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-11 05:40:00 +00:00
We should work towards a pattern where we take StringView as function arguments, and store String as member, to push the String construction to the last possible moment.
33 lines
617 B
C++
33 lines
617 B
C++
#pragma once
|
|
|
|
#include "AKString.h"
|
|
|
|
namespace AK {
|
|
|
|
class FileSystemPath {
|
|
public:
|
|
FileSystemPath() {}
|
|
explicit FileSystemPath(const StringView&);
|
|
|
|
bool is_valid() const { return m_is_valid; }
|
|
String string() const { return m_string; }
|
|
|
|
String basename() const { return m_basename; }
|
|
|
|
const Vector<String>& parts() const { return m_parts; }
|
|
|
|
bool has_extension(StringView) const;
|
|
|
|
private:
|
|
bool canonicalize(bool resolve_symbolic_links = false);
|
|
|
|
Vector<String> m_parts;
|
|
String m_string;
|
|
String m_basename;
|
|
bool m_is_valid { false };
|
|
};
|
|
|
|
};
|
|
|
|
using AK::FileSystemPath;
|