midday-commander
Loading...
Searching...
No Matches
Utility.h
Go to the documentation of this file.
1//
2// Created by Vojtěch Pašek on 19.05.2023.
3//
4
5#ifndef MIDDAY_COMMANDER_UTILITY_H
6#define MIDDAY_COMMANDER_UTILITY_H
7
8#include <string>
9
10#include "entry/Entry.h"
11
15class Utility {
16public:
20 static std::string escape(const std::string& str);
21
25 static std::shared_ptr<Entry> makeEntry(const std::filesystem::path& path);
26
30 static std::string getHash(const std::filesystem::path& path);
31};
32
33
34#endif //MIDDAY_COMMANDER_UTILITY_H
A set of utility functions.
Definition: Utility.h:15
static std::shared_ptr< Entry > makeEntry(const std::filesystem::path &path)
Makes the correct entry object based on it's path.
Definition: Utility.cpp:45
static std::string getHash(const std::filesystem::path &path)
Generates an MD5 hash of a file.
Definition: Utility.cpp:55
static std::string escape(const std::string &str)
Escapes a string so it can be printed.
Definition: Utility.cpp:14