refactoring
Co-authored-by: n.fedorov <mail@nfedorov.dev> Co-committed-by: n.fedorov <mail@nfedorov.dev>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2024-2026 NXST contributors
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
class Directory {
|
||||
public:
|
||||
explicit Directory(const std::string& path);
|
||||
|
||||
bool good() const {
|
||||
return m_good;
|
||||
}
|
||||
Result error() const {
|
||||
return m_error;
|
||||
}
|
||||
size_t size() const {
|
||||
return m_entries.size();
|
||||
}
|
||||
std::string entry(size_t i) const;
|
||||
bool folder(size_t i) const;
|
||||
|
||||
private:
|
||||
struct Entry {
|
||||
std::string name;
|
||||
bool is_dir;
|
||||
};
|
||||
std::vector<Entry> m_entries;
|
||||
Result m_error{0};
|
||||
bool m_good{false};
|
||||
};
|
||||
Reference in New Issue
Block a user