mirror-chatterino2/src/util/DebugCount.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
815 B
C++
Raw Normal View History

2018-04-06 16:37:30 +02:00
#pragma once
#include "common/FlagsEnum.hpp"
2018-04-06 16:37:30 +02:00
#include <QString>
2018-04-06 16:37:30 +02:00
namespace chatterino {
2018-04-06 16:37:30 +02:00
class DebugCount
{
public:
enum class Flag : uint16_t {
None = 0,
/// The value is a data size in bytes
DataSize = 1 << 0,
};
using Flags = FlagsEnum<Flag>;
static void configure(const QString &name, Flags flags);
static void set(const QString &name, const int64_t &amount);
static void increase(const QString &name, const int64_t &amount);
static void increase(const QString &name)
{
DebugCount::increase(name, 1);
}
static void decrease(const QString &name, const int64_t &amount);
2018-04-06 16:37:30 +02:00
static void decrease(const QString &name)
{
DebugCount::decrease(name, 1);
2018-04-06 16:37:30 +02:00
}
static QString getDebugText();
2018-04-06 16:37:30 +02:00
};
2018-04-06 16:37:30 +02:00
} // namespace chatterino