Files
frelay/Util/Util.h

39 lines
901 B
C
Raw Normal View History

2025-06-14 23:25:16 +08:00
#ifndef UTIL_H
#define UTIL_H
#include <QObject>
2025-06-15 14:31:54 +08:00
#include <InfoDirFile.h>
2025-06-14 23:25:16 +08:00
class Util : public QObject
{
Q_OBJECT
public:
Util();
public:
static void InitLogger(const QString& logPath, const QString& mark);
static void ConsoleMsgHander(QtMsgType type, const QMessageLogContext& context, const QString& msg);
};
2025-06-15 14:31:54 +08:00
class DirFileHelper
{
public:
DirFileHelper() = default;
virtual ~DirFileHelper() = default;
public:
QString GetErr() const;
void registerPathCall(const std::function<void(const QString& path)>& call);
void registerFileCall(const std::function<void(const DirFileInfoVec& vec)>& call);
protected:
QString err_;
std::function<void(const QString& path)> pathCall_;
std::function<void(const DirFileInfoVec& info)> fileCall_;
public:
virtual bool GetHome() = 0;
virtual bool GetDirFile(const QString& dir) = 0;
};
2025-06-14 23:25:16 +08:00
#endif // UTIL_H