mirror of
https://github.com/SerenityOS/serenity
synced 2024-11-05 17:46:52 +00:00
de65c960e9
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.
32 lines
631 B
C++
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;
|