mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Move ODesc to zeek namespace
This commit is contained in:
parent
fdcb2760b2
commit
4e9a5e9d98
53 changed files with 162 additions and 143 deletions
|
@ -51,8 +51,8 @@ public:
|
|||
* @return Returns true on success, false on error. Errors must also
|
||||
* be flagged via the thread.
|
||||
*/
|
||||
virtual bool Describe(ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
threading::Value** vals) const = 0;
|
||||
virtual bool Describe(zeek::ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
threading::Value** vals) const = 0;
|
||||
|
||||
/**
|
||||
* Convert a single threading value into an implementation-specific
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
* @return Returns true on success, false on error. Errors are also
|
||||
* flagged via the thread.
|
||||
*/
|
||||
virtual bool Describe(ODesc* desc, threading::Value* val, const std::string& name = "") const = 0;
|
||||
virtual bool Describe(zeek::ODesc* desc, threading::Value* val, const std::string& name = "") const = 0;
|
||||
|
||||
/**
|
||||
* Convert an implementation-specific textual representation of a
|
||||
|
|
|
@ -15,7 +15,7 @@ using namespace threading::formatter;
|
|||
// If the value we'd write out would match exactly the a reserved string, we
|
||||
// escape the first character so that the output won't be ambigious. If this
|
||||
// function returns true, it has added an escaped version of data to desc.
|
||||
static inline bool escapeReservedContent(ODesc* desc, const string& reserved, const char* data, int size)
|
||||
static inline bool escapeReservedContent(zeek::ODesc* desc, const string& reserved, const char* data, int size)
|
||||
{
|
||||
if ( size != (int)reserved.size() || memcmp(data, reserved.data(), size) != 0 )
|
||||
return false;
|
||||
|
@ -56,7 +56,7 @@ Ascii::~Ascii()
|
|||
{
|
||||
}
|
||||
|
||||
bool Ascii::Describe(ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
bool Ascii::Describe(zeek::ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
threading::Value** vals) const
|
||||
{
|
||||
for ( int i = 0; i < num_fields; i++ )
|
||||
|
@ -71,7 +71,7 @@ bool Ascii::Describe(ODesc* desc, int num_fields, const threading::Field* const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Ascii::Describe(ODesc* desc, threading::Value* val, const string& name) const
|
||||
bool Ascii::Describe(zeek::ODesc* desc, threading::Value* val, const string& name) const
|
||||
{
|
||||
if ( ! val->present )
|
||||
{
|
||||
|
|
|
@ -47,8 +47,8 @@ public:
|
|||
Ascii(threading::MsgThread* t, const SeparatorInfo& info);
|
||||
virtual ~Ascii();
|
||||
|
||||
virtual bool Describe(ODesc* desc, threading::Value* val, const std::string& name = "") const;
|
||||
virtual bool Describe(ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
virtual bool Describe(zeek::ODesc* desc, threading::Value* val, const std::string& name = "") const;
|
||||
virtual bool Describe(zeek::ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
threading::Value** vals) const;
|
||||
virtual threading::Value* ParseValue(const std::string& s, const std::string& name,
|
||||
zeek::TypeTag type, zeek::TypeTag subtype = zeek::TYPE_ERROR) const;
|
||||
|
|
|
@ -35,7 +35,7 @@ JSON::~JSON()
|
|||
{
|
||||
}
|
||||
|
||||
bool JSON::Describe(ODesc* desc, int num_fields, const Field* const * fields,
|
||||
bool JSON::Describe(zeek::ODesc* desc, int num_fields, const Field* const * fields,
|
||||
Value** vals) const
|
||||
{
|
||||
rapidjson::StringBuffer buffer;
|
||||
|
@ -55,7 +55,7 @@ bool JSON::Describe(ODesc* desc, int num_fields, const Field* const * fields,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool JSON::Describe(ODesc* desc, Value* val, const std::string& name) const
|
||||
bool JSON::Describe(zeek::ODesc* desc, Value* val, const std::string& name) const
|
||||
{
|
||||
if ( desc->IsBinary() )
|
||||
{
|
||||
|
|
|
@ -25,10 +25,11 @@ public:
|
|||
JSON(threading::MsgThread* t, TimeFormat tf);
|
||||
~JSON() override;
|
||||
|
||||
bool Describe(ODesc* desc, threading::Value* val, const std::string& name = "") const override;
|
||||
bool Describe(ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
threading::Value** vals) const override;
|
||||
threading::Value* ParseValue(const std::string& s, const std::string& name, zeek::TypeTag type, zeek::TypeTag subtype = zeek::TYPE_ERROR) const override;
|
||||
bool Describe(zeek::ODesc* desc, threading::Value* val, const std::string& name = "") const override;
|
||||
bool Describe(zeek::ODesc* desc, int num_fields, const threading::Field* const * fields,
|
||||
threading::Value** vals) const override;
|
||||
threading::Value* ParseValue(const std::string& s, const std::string& name, zeek::TypeTag type,
|
||||
zeek::TypeTag subtype = zeek::TYPE_ERROR) const override;
|
||||
|
||||
class NullDoubleWriter : public rapidjson::Writer<rapidjson::StringBuffer> {
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue