mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Reformat the world
This commit is contained in:
parent
194cb24547
commit
b2f171ec69
714 changed files with 35149 additions and 35203 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue