LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
parser::anonymous_namespace{SapiLogParser.cpp} Namespace Reference

Typedefs

using Pairs = std::vector< std::pair< std::string, std::string > >
 

Functions

bool ReadGroup (std::string_view line, size_t &pos, std::string_view &content)
 
std::string_view Trim (std::string_view s)
 
bool LooksLikeIsoTimestamp (std::string_view ts)
 Cheap sanity check that a field looks like "YYYY-MM-DD…".
 
bool IsBlank (char c)
 
bool SplitTokens (std::string_view s, std::vector< std::string_view > &tokens)
 
bool IsValidKey (std::string_view key)
 
bool ParseKeyValue (std::string_view token, Pairs &pairs)
 
bool ExtractKeyValues (std::string_view payload, Pairs &pairs)
 
std::string JsonText (const nlohmann::ordered_json &v)
 
bool ExtractJson (std::string_view payload, Pairs &pairs)
 Flat or one-level-deep JSON object; deeper values stay compact JSON text.
 

Variables

constexpr size_t kBatchSize = 5000
 
constexpr size_t kFixedFields = 7
 
constexpr std::string_view kHeaderMarker = "# FULL MERGED TEST STEPS"
 
constexpr int kHeaderProbeLines = 5
 
constexpr size_t kSniffBytes = 4096
 
constexpr std::string_view kUtf8Bom = "\xEF\xBB\xBF"
 
constexpr std::string_view kPayloadPrefix = "p."
 
constexpr size_t kMaxPayloadLength = 4096
 
constexpr size_t kMaxPayloadFields = 32
 
constexpr size_t kMaxFieldKeyLength = 64
 
constexpr size_t kMaxFieldValueLength = 512
 

Typedef Documentation

◆ Pairs

using parser::anonymous_namespace{SapiLogParser.cpp}::Pairs = typedef std::vector<std::pair<std::string, std::string> >

Function Documentation

◆ ExtractJson()

bool parser::anonymous_namespace{SapiLogParser.cpp}::ExtractJson ( std::string_view  payload,
Pairs &  pairs 
)

Flat or one-level-deep JSON object; deeper values stay compact JSON text.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExtractKeyValues()

bool parser::anonymous_namespace{SapiLogParser.cpp}::ExtractKeyValues ( std::string_view  payload,
Pairs &  pairs 
)

key=value tokens, optionally inside bracket groups (one level). A group holding a single word without '=' is a label ([P0]) and is skipped.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsBlank()

bool parser::anonymous_namespace{SapiLogParser.cpp}::IsBlank ( char  c)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsValidKey()

bool parser::anonymous_namespace{SapiLogParser.cpp}::IsValidKey ( std::string_view  key)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ JsonText()

std::string parser::anonymous_namespace{SapiLogParser.cpp}::JsonText ( const nlohmann::ordered_json &  v)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LooksLikeIsoTimestamp()

bool parser::anonymous_namespace{SapiLogParser.cpp}::LooksLikeIsoTimestamp ( std::string_view  ts)

Cheap sanity check that a field looks like "YYYY-MM-DD…".

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseKeyValue()

bool parser::anonymous_namespace{SapiLogParser.cpp}::ParseKeyValue ( std::string_view  token,
Pairs &  pairs 
)

Parses one key=value token; a value wrapped in matching quotes is unquoted (backslash escapes the next character).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadGroup()

bool parser::anonymous_namespace{SapiLogParser.cpp}::ReadGroup ( std::string_view  line,
size_t &  pos,
std::string_view &  content 
)

Reads the balanced [...] group starting at line[pos] (which must be '['). On success content is the text between the outer brackets and pos moves past the closing ']'. Returns false when the group never closes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SplitTokens()

bool parser::anonymous_namespace{SapiLogParser.cpp}::SplitTokens ( std::string_view  s,
std::vector< std::string_view > &  tokens 
)

Splits s at whitespace outside [...]/{...} and outside a quoted value (a quote right after '='). False on unbalanced brackets or an unterminated quote.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Trim()

std::string_view parser::anonymous_namespace{SapiLogParser.cpp}::Trim ( std::string_view  s)

Variable Documentation

◆ kBatchSize

constexpr size_t parser::anonymous_namespace{SapiLogParser.cpp}::kBatchSize = 5000
constexpr

◆ kFixedFields

constexpr size_t parser::anonymous_namespace{SapiLogParser.cpp}::kFixedFields = 7
constexpr

◆ kHeaderMarker

constexpr std::string_view parser::anonymous_namespace{SapiLogParser.cpp}::kHeaderMarker = "# FULL MERGED TEST STEPS"
constexpr

◆ kHeaderProbeLines

constexpr int parser::anonymous_namespace{SapiLogParser.cpp}::kHeaderProbeLines = 5
constexpr

◆ kMaxFieldKeyLength

constexpr size_t parser::anonymous_namespace{SapiLogParser.cpp}::kMaxFieldKeyLength = 64
constexpr

◆ kMaxFieldValueLength

constexpr size_t parser::anonymous_namespace{SapiLogParser.cpp}::kMaxFieldValueLength = 512
constexpr

◆ kMaxPayloadFields

constexpr size_t parser::anonymous_namespace{SapiLogParser.cpp}::kMaxPayloadFields = 32
constexpr

◆ kMaxPayloadLength

constexpr size_t parser::anonymous_namespace{SapiLogParser.cpp}::kMaxPayloadLength = 4096
constexpr

◆ kPayloadPrefix

constexpr std::string_view parser::anonymous_namespace{SapiLogParser.cpp}::kPayloadPrefix = "p."
constexpr

◆ kSniffBytes

constexpr size_t parser::anonymous_namespace{SapiLogParser.cpp}::kSniffBytes = 4096
constexpr

◆ kUtf8Bom

constexpr std::string_view parser::anonymous_namespace{SapiLogParser.cpp}::kUtf8Bom = "\xEF\xBB\xBF"
constexpr