ladybird/AK/FileSystemPath.h
Andreas Kling de65c960e9 Kernel: Tweak some String&& => const String&.
String&& is just not very practical. Also return const String& when the
returned string is a member variable. The call site is free to make a copy
if he wants, but otherwise we can avoid the retain count churn.
2019-06-07 20:58:12 +02:00

32 lines
631 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; }
const String& string() const { return m_string; }
const 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;