initial port for Cevo game in C++ (libs)

This commit is contained in:
Geoffray Levasseur committed 2026-10-22 17:20:45 +02:00
commit 8436242032
375 files changed
+46282

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
#pragma once
#include <QDateTime>
#include <QList>
#include <QMutex>
#include <QObject>
#include <QString>
namespace Cevo {
struct DebugLogItem {
QDateTime time;
QString group;
QString text;
};
// Equivalent of DebugLog.pas's TDebugLog: a thread-safe, capped, optionally
// file-backed log.
class DebugLog : public QObject {
Q_OBJECT
public:
explicit DebugLog(QObject *parent = nullptr);
void add(QString text, QString group = QString());
void writeToFile(QString text) const;
QList<DebugLogItem> items() const;
int maxCount() const { return m_maxCount; }
void setMaxCount(int value);
QString fileName = QStringLiteral("DebugLog.txt");
bool writeToFileEnable = false;
signals:
void newItem(const DebugLogItem &item);
private:
mutable QMutex m_lock;
QList<DebugLogItem> m_items;
int m_maxCount = 100;
};
} // namespace Cevo