mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
43 lines
804 B
C++
43 lines
804 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <utility>
|
|
|
|
class QByteArray;
|
|
class QString;
|
|
|
|
namespace chatterino {
|
|
|
|
class Paths;
|
|
|
|
} // namespace chatterino
|
|
|
|
namespace chatterino::ipc {
|
|
|
|
void initPaths(const Paths *paths);
|
|
|
|
void sendMessage(const char *name, const QByteArray &data);
|
|
|
|
class IpcQueuePrivate;
|
|
class IpcQueue
|
|
{
|
|
public:
|
|
~IpcQueue();
|
|
|
|
static std::pair<std::unique_ptr<IpcQueue>, QString> tryReplaceOrCreate(
|
|
const char *name, size_t maxMessages, size_t maxMessageSize);
|
|
|
|
// TODO: use std::expected
|
|
/// Try to receive a message.
|
|
/// In the case of an error, the buffer is empty.
|
|
QByteArray receive();
|
|
|
|
private:
|
|
IpcQueue(IpcQueuePrivate *priv);
|
|
|
|
std::unique_ptr<IpcQueuePrivate> private_;
|
|
|
|
friend class IpcQueuePrivate;
|
|
};
|
|
|
|
} // namespace chatterino::ipc
|