midday-commander
Loading...
Searching...
No Matches
FileView.h
Go to the documentation of this file.
1//
2// Created by Vojtěch Pašek on 11.05.2023.
3//
4
5#ifndef MIDDAY_COMMANDER_FILEVIEW_H
6#define MIDDAY_COMMANDER_FILEVIEW_H
7
8#include <vector>
9#include <filesystem>
10
11#include "entry/Entry.h"
12
16class FileView {
17public:
21 FileView();
22
26 explicit FileView(std::filesystem::path wd);
27
31 std::filesystem::path wd;
32
33 size_t cursor = 0;
34 size_t scroll_cursor = 0;
35
39 [[nodiscard]] std::vector<std::shared_ptr<Entry>> getCurrent(bool recursive = false);
40
44 void cd(std::filesystem::path);
45};
46
47
48#endif //MIDDAY_COMMANDER_FILEVIEW_H
Represents a file view of the Application.
Definition: FileView.h:16
size_t cursor
Definition: FileView.h:33
std::filesystem::path wd
Working directory.
Definition: FileView.h:31
void cd(std::filesystem::path)
Change directory.
Definition: FileView.cpp:31
FileView()
Constructs a FileView with wd set as the current directory.
Definition: FileView.cpp:9
size_t scroll_cursor
Definition: FileView.h:34
std::vector< std::shared_ptr< Entry > > getCurrent(bool recursive=false)
Get Entries representing all files/folders in wd.
Definition: FileView.cpp:15