mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Merge branch 'topic/bernhard/input-logging-commmon-functions' into topic/bernhard/sqlite
This commit is contained in:
commit
53a919be81
4 changed files with 20 additions and 5 deletions
|
@ -13,12 +13,21 @@ AsciiInputOutput::AsciiInputOutput(threading::MsgThread* t)
|
||||||
}
|
}
|
||||||
|
|
||||||
AsciiInputOutput::AsciiInputOutput(threading::MsgThread* t, const string & separator, const string & set_separator,
|
AsciiInputOutput::AsciiInputOutput(threading::MsgThread* t, const string & separator, const string & set_separator,
|
||||||
const string & empty_field, const string & unset_field)
|
const string & unset_field, const string & empty_field)
|
||||||
{
|
{
|
||||||
thread = t;
|
thread = t;
|
||||||
this->separator = separator;
|
this->separator = separator;
|
||||||
this->set_separator = set_separator;
|
this->set_separator = set_separator;
|
||||||
|
this->unset_field = unset_field;
|
||||||
this->empty_field = empty_field;
|
this->empty_field = empty_field;
|
||||||
|
}
|
||||||
|
|
||||||
|
AsciiInputOutput::AsciiInputOutput(threading::MsgThread* t, const string & separator, const string & set_separator,
|
||||||
|
const string & unset_field)
|
||||||
|
{
|
||||||
|
thread = t;
|
||||||
|
this->separator = separator;
|
||||||
|
this->set_separator = set_separator;
|
||||||
this->unset_field = unset_field;
|
this->unset_field = unset_field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +284,7 @@ threading::Value* AsciiInputOutput::EntryToVal(string s, string name, TypeTag ty
|
||||||
|
|
||||||
unsigned int pos = 0;
|
unsigned int pos = 0;
|
||||||
|
|
||||||
if ( s.compare(empty_field) == 0 )
|
if ( empty_field.size() > 0 && s.compare(empty_field) == 0 )
|
||||||
length = 0;
|
length = 0;
|
||||||
|
|
||||||
threading::Value** lvals = new threading::Value* [length];
|
threading::Value** lvals = new threading::Value* [length];
|
||||||
|
|
|
@ -15,7 +15,13 @@ class AsciiInputOutput {
|
||||||
// Constructor that defines all separators, etc.
|
// Constructor that defines all separators, etc.
|
||||||
// Use if you need either ValToODesc or EntryToVal.
|
// Use if you need either ValToODesc or EntryToVal.
|
||||||
AsciiInputOutput(threading::MsgThread*, const string & separator, const string & set_separator,
|
AsciiInputOutput(threading::MsgThread*, const string & separator, const string & set_separator,
|
||||||
const string & empty_field, const string & unset_field);
|
const string & unset_field, const string & empty_field);
|
||||||
|
|
||||||
|
// Constructor that defines all separators, etc, besides empty_field, which is not needed for many
|
||||||
|
// non-ascii-based io sources.
|
||||||
|
// Use if you need either ValToODesc or EntryToVal.
|
||||||
|
AsciiInputOutput(threading::MsgThread*, const string & separator, const string & set_separator,
|
||||||
|
const string & unset_field);
|
||||||
~AsciiInputOutput();
|
~AsciiInputOutput();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ Ascii::Ascii(ReaderFrontend *frontend) : ReaderBackend(frontend)
|
||||||
unset_field.assign( (const char*) BifConst::InputAscii::unset_field->Bytes(),
|
unset_field.assign( (const char*) BifConst::InputAscii::unset_field->Bytes(),
|
||||||
BifConst::InputAscii::unset_field->Len());
|
BifConst::InputAscii::unset_field->Len());
|
||||||
|
|
||||||
io = new AsciiInputOutput(this, separator, set_separator, empty_field, unset_field);
|
io = new AsciiInputOutput(this, separator, set_separator, unset_field, empty_field);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ascii::~Ascii()
|
Ascii::~Ascii()
|
||||||
|
|
|
@ -52,7 +52,7 @@ Ascii::Ascii(WriterFrontend* frontend) : WriterBackend(frontend)
|
||||||
desc.EnableEscaping();
|
desc.EnableEscaping();
|
||||||
desc.AddEscapeSequence(separator);
|
desc.AddEscapeSequence(separator);
|
||||||
|
|
||||||
io = new AsciiInputOutput(this, separator, set_separator, empty_field, unset_field);
|
io = new AsciiInputOutput(this, separator, set_separator, unset_field, empty_field);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ascii::~Ascii()
|
Ascii::~Ascii()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue