summaryrefslogtreecommitdiff
path: root/AK/FileSystemPath.h
blob: 4e09386ed7004343c9d80882ff85f23836e57f3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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;