Reformat the world

This commit is contained in:
Tim Wojtulewicz 2021-09-16 15:35:39 -07:00
parent 194cb24547
commit b2f171ec69
714 changed files with 35149 additions and 35203 deletions

View file

@ -2,23 +2,26 @@
#pragma once
#include "zeek/zeek-config.h"
#include <stdint.h>
#include <string>
#include "zeek/zeek-config.h"
struct in_addr;
struct in6_addr;
namespace zeek {
namespace zeek
{
class IPAddr;
class IPPrefix;
namespace detail {
namespace detail
{
// Abstract base class.
class SerializationFormat {
class SerializationFormat
{
public:
SerializationFormat();
virtual ~SerializationFormat();
@ -42,7 +45,7 @@ public:
virtual bool Read(in6_addr* addr, const char* tag) = 0;
// Returns number of raw bytes read since last call to StartRead().
int BytesRead() const { return bytes_read; }
int BytesRead() const { return bytes_read; }
// Passes ownership of string.
virtual bool Read(char** str, int* len, const char* tag) = 0;
@ -80,7 +83,7 @@ public:
virtual bool WriteSeparator() = 0;
// Returns number of raw bytes written since last call to StartWrite().
int BytesWritten() const { return bytes_written; }
int BytesWritten() const { return bytes_written; }
protected:
bool ReadData(void* buf, size_t count);
@ -98,9 +101,10 @@ protected:
int bytes_written;
int bytes_read;
};
};
class BinarySerializationFormat final : public SerializationFormat {
class BinarySerializationFormat final : public SerializationFormat
{
public:
BinarySerializationFormat();
~BinarySerializationFormat() override;
@ -137,7 +141,7 @@ public:
bool WriteOpenTag(const char* tag) override;
bool WriteCloseTag(const char* tag) override;
bool WriteSeparator() override;
};
};
} // namespace zeek::detail
} // namespace zeek
} // namespace zeek::detail
} // namespace zeek