ladybird/AK/FileSystemPath.h
rhin123 a175e76948 TextEditor: Include extension during SaveAs
When we save-as in the text editor we now auto-populate GFilePicker /w
the current name & extension.
2019-07-29 20:46:31 +02:00

39 lines
829 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 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::FileSystemPath;
using AK::canonicalized_path;