Use clang-format for all files in testing/btest/plugins.

This is a fixup commit for dc65b6248c.
This commit is contained in:
Benjamin Bannier 2022-07-13 17:43:18 +02:00
parent 96a14b39fa
commit 489534bd74
28 changed files with 208 additions and 160 deletions

View file

@ -1,37 +1,43 @@
#pragma once
#include "Desc.h"
#include "logging/WriterBackend.h"
#include "threading/formatters/Ascii.h"
#include "Desc.h"
namespace btest::logging::writer {
namespace btest::logging::writer
{
class Foo : public zeek::logging::WriterBackend {
class Foo : public zeek::logging::WriterBackend
{
public:
Foo(zeek::logging::WriterFrontend* frontend) : zeek::logging::WriterBackend(frontend) {}
Foo(zeek::logging::WriterFrontend* frontend) : zeek::logging::WriterBackend(frontend) { }
~Foo();
static zeek::logging::WriterBackend* Instantiate(zeek::logging::WriterFrontend* frontend)
{ return new Foo(frontend); }
{
return new Foo(frontend);
}
protected:
virtual bool DoInit(const zeek::logging::WriterBackend::WriterInfo& info, int num_fields,
const zeek::threading::Field* const * fields);
const zeek::threading::Field* const* fields);
virtual bool DoWrite(int num_fields, const zeek::threading::Field* const* fields,
zeek::threading::Value** vals);
virtual bool DoSetBuf(bool enabled) { return true; }
virtual bool DoRotate(const char* rotated_path, double open,
double close, bool terminating) { return true; }
virtual bool DoFlush(double network_time) { return true; }
virtual bool DoFinish(double network_time) { return true; }
virtual bool DoHeartbeat(double network_time, double current_time) { return true; }
virtual bool DoSetBuf(bool enabled) { return true; }
virtual bool DoRotate(const char* rotated_path, double open, double close, bool terminating)
{
return true;
}
virtual bool DoFlush(double network_time) { return true; }
virtual bool DoFinish(double network_time) { return true; }
virtual bool DoHeartbeat(double network_time, double current_time) { return true; }
private:
std::string path;
zeek::ODesc desc;
zeek::threading::Formatter* formatter;
};
};
}
}

View file

@ -3,15 +3,16 @@
#include <plugin/Plugin.h>
namespace btest::plugin::Demo_Foo {
namespace btest::plugin::Demo_Foo
{
class Plugin : public zeek::plugin::Plugin
{
{
protected:
// Overridden from plugin::Plugin.
virtual zeek::plugin::Configuration Configure();
};
};
extern Plugin plugin;
}
}