mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
37 lines
761 B
C++
37 lines
761 B
C++
#pragma once
|
|
|
|
#include "messages/message.hpp"
|
|
|
|
#include <QDateTime>
|
|
#include <QFile>
|
|
#include <QString>
|
|
|
|
#include <memory>
|
|
|
|
namespace chatterino {
|
|
namespace logging {
|
|
|
|
class Channel
|
|
{
|
|
public:
|
|
explicit Channel(const QString &_channelName, const QString &_baseDirectory);
|
|
~Channel();
|
|
|
|
void append(std::shared_ptr<messages::Message> message);
|
|
|
|
private:
|
|
QString generateOpeningString(const QDateTime &now = QDateTime::currentDateTime()) const;
|
|
QString generateClosingString(const QDateTime &now = QDateTime::currentDateTime()) const;
|
|
|
|
void appendLine(const QString &line);
|
|
|
|
private:
|
|
QString channelName;
|
|
const QString &baseDirectory;
|
|
QString fileName;
|
|
QFile fileHandle;
|
|
};
|
|
|
|
} // namespace logging
|
|
} // namespace chatterino
|