LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
parser Namespace Reference

Data parsing components and interfaces. More...

Namespaces

namespace  anonymous_namespace{AscParser.cpp}
 
namespace  anonymous_namespace{ParserFactory.cpp}
 
namespace  anonymous_namespace{SapiLogParser.cpp}
 
namespace  dbc
 

Classes

class  AscParser
 Parses Vector CANalyzer ASC log files (.asc). More...
 
class  CsvParser
 Parses CSV formatted log files. More...
 
class  DltParser
 
class  EvlogParser
 
struct  EvlogTemplate
 
struct  EvlogTemplateField
 
class  EvlogTemplateRegistry
 
class  IDataParser
 Abstract base class for all data parsing implementations. More...
 
class  IDataParserObserver
 Observer interface for receiving notifications from data parsers. More...
 
class  JsonParser
 
class  ParserFactory
 Factory class for creating parser instances. More...
 
struct  ParserState
 
class  SapiLogParser
 Parses merged test-run logs produced by the safeAPI RBC 2oo2 test environment (robot steps + container + simulator logs in one file). More...
 
class  XmlParser
 

Enumerations

enum class  ParserType { XML , JSON , CSV , Custom }
 Supported parser types. More...
 

Functions

static uint16_t BE16 (const uint8_t *p) noexcept
 
static uint32_t BE32 (const uint8_t *p) noexcept
 
static uint16_t LE16 (const uint8_t *p) noexcept
 
static uint32_t LE32 (const uint8_t *p) noexcept
 
static std::string ReadId4 (const uint8_t *p)
 Extract a null-padded 4-char ID (ECU/App/Ctx) as a trimmed std::string.
 
static std::string HexDump (const uint8_t *data, size_t size, size_t maxBytes=16)
 Hex dump of up to maxBytes bytes (space-separated uppercase).
 
static std::string DecodeArg (const uint8_t *data, size_t avail, size_t &consumed, bool msbf)
 
static std::string DecodeVerbose (const uint8_t *payload, size_t size, bool msbf, uint8_t numArgs)
 Decode all verbose arguments into a single space-joined string.
 
static uint16_t LE16u (const uint8_t *p) noexcept
 
static uint32_t LE32u (const uint8_t *p) noexcept
 
static int32_t LE32s (const uint8_t *p) noexcept
 
static uint64_t LE64u (const uint8_t *p) noexcept
 
static const char * SeverityName (int32_t s) noexcept
 
static const char * FacilityName (int32_t fac) noexcept
 
static std::string FlagsString (uint32_t flags)
 
static std::string HexDump (const uint8_t *data, size_t size, size_t maxBytes=32)
 
static std::string DecodeWithTemplate (const uint8_t *data, uint32_t size, const EvlogTemplate &tmpl)
 
static std::string DecodeString (const uint8_t *data, uint32_t size)
 
static std::string DecodePrintf (const uint8_t *data, uint32_t size)
 
static std::string Trim (const std::string &s)
 
static std::string Unquote (const std::string &s)
 
static std::string StripComment (const std::string &line)
 
static std::string NormalizeKeyword (const std::string &s)
 
static int32_t ParseFacility (const std::string &s)
 
static uint32_t ParseUint32 (const std::string &s)
 
static EvlogTemplateField::Type MapType (const std::string &t)
 
static std::optional< EvlogTemplateField > ParseFieldDecl (std::string line)
 
static void CommitTemplate (EvlogTemplate &tmpl, std::map< std::pair< int32_t, uint32_t >, EvlogTemplate > &out)
 
static void StartElementHandler (void *userData, const XML_Char *name, const XML_Char **atts)
 
static void EndElementHandler (void *userData, const XML_Char *name)
 
static void CharacterDataHandler (void *userData, const XML_Char *s, int len)
 

Variables

static constexpr uint8_t kMagic [4] = {'D', 'L', 'T', 0x01}
 
static constexpr size_t kStorageHdrSize = 16
 
static constexpr size_t kProgressBatch = 512
 
static constexpr uint8_t HTYP_UEH = 0x01
 
static constexpr uint8_t HTYP_MSBF = 0x02
 
static constexpr uint8_t HTYP_WEID = 0x04
 
static constexpr uint8_t HTYP_WSID = 0x08
 
static constexpr uint8_t HTYP_WTMS = 0x10
 
static constexpr uint8_t DLT_TYPE_LOG = 0
 
static constexpr uint32_t TI_TYLE = 0x0000000Fu
 
static constexpr uint32_t TI_BOOL = (1u << 4)
 
static constexpr uint32_t TI_SINT = (1u << 5)
 
static constexpr uint32_t TI_UINT = (1u << 6)
 
static constexpr uint32_t TI_FLOA = (1u << 7)
 
static constexpr uint32_t TI_STRG = (1u << 9)
 
static constexpr uint32_t TI_RAWD = (1u << 10)
 
static constexpr uint32_t TI_VARI = (1u << 11)
 
static const char *const kLogLevels []
 
static const char *const kMsgTypes []
 
static constexpr size_t kHdrSize = 60
 
static constexpr size_t kProgressBatch = 512
 
static constexpr size_t kOff_recid = 0
 
static constexpr size_t kOff_size = 4
 
static constexpr size_t kOff_format = 8
 
static constexpr size_t kOff_event_type = 12
 
static constexpr size_t kOff_facility = 16
 
static constexpr size_t kOff_severity = 20
 
static constexpr size_t kOff_uid = 24
 
static constexpr size_t kOff_gid = 28
 
static constexpr size_t kOff_pid = 32
 
static constexpr size_t kOff_tv_sec = 40
 
static constexpr size_t kOff_tv_nsec = 44
 
static constexpr size_t kOff_flags = 48
 
static constexpr size_t kOff_processor = 56
 
static constexpr uint32_t F_TRUNCATE = 0x01
 
static constexpr uint32_t F_KERNEL = 0x02
 
static constexpr uint32_t F_BOOT = 0x04
 
static constexpr uint32_t F_KERNTIME = 0x08
 
static constexpr uint32_t F_INTERRUPT = 0x10
 
static constexpr uint32_t F_PRINTK = 0x20
 
static constexpr uint32_t kMaxPayload = 64 * 1024
 
static constexpr int32_t kMaxSeverity = 7
 

Detailed Description

Data parsing components and interfaces.

Enumeration Type Documentation

◆ ParserType

enum class parser::ParserType
strong

Supported parser types.

Enumerator
XML 

XML log file parser.

JSON 

JSON log file parser (future)

CSV 

CSV log file parser (future)

Custom 

Custom registered parser.

Function Documentation

◆ BE16()

static uint16_t parser::BE16 ( const uint8_t *  p)
staticnoexcept
Here is the caller graph for this function:

◆ BE32()

static uint32_t parser::BE32 ( const uint8_t *  p)
staticnoexcept
Here is the caller graph for this function:

◆ CharacterDataHandler()

static void parser::CharacterDataHandler ( void *  userData,
const XML_Char *  s,
int  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommitTemplate()

static void parser::CommitTemplate ( EvlogTemplate &  tmpl,
std::map< std::pair< int32_t, uint32_t >, EvlogTemplate > &  out 
)
static
Here is the caller graph for this function:

◆ DecodeArg()

static std::string parser::DecodeArg ( const uint8_t *  data,
size_t  avail,
size_t &  consumed,
bool  msbf 
)
static

Decode one typed argument from data[0..avail). Sets consumed to the number of bytes consumed (0 on parse failure).

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

◆ DecodePrintf()

static std::string parser::DecodePrintf ( const uint8_t *  data,
uint32_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecodeString()

static std::string parser::DecodeString ( const uint8_t *  data,
uint32_t  size 
)
static
Here is the caller graph for this function:

◆ DecodeVerbose()

static std::string parser::DecodeVerbose ( const uint8_t *  payload,
size_t  size,
bool  msbf,
uint8_t  numArgs 
)
static

Decode all verbose arguments into a single space-joined string.

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

◆ DecodeWithTemplate()

static std::string parser::DecodeWithTemplate ( const uint8_t *  data,
uint32_t  size,
const EvlogTemplate &  tmpl 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndElementHandler()

static void parser::EndElementHandler ( void *  userData,
const XML_Char *  name 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FacilityName()

static const char * parser::FacilityName ( int32_t  fac)
staticnoexcept
Here is the caller graph for this function:

◆ FlagsString()

static std::string parser::FlagsString ( uint32_t  flags)
static
Here is the caller graph for this function:

◆ HexDump() [1/2]

static std::string parser::HexDump ( const uint8_t *  data,
size_t  size,
size_t  maxBytes = 16 
)
static

Hex dump of up to maxBytes bytes (space-separated uppercase).

Here is the caller graph for this function:

◆ HexDump() [2/2]

static std::string parser::HexDump ( const uint8_t *  data,
size_t  size,
size_t  maxBytes = 32 
)
static

◆ LE16()

static uint16_t parser::LE16 ( const uint8_t *  p)
staticnoexcept
Here is the caller graph for this function:

◆ LE16u()

static uint16_t parser::LE16u ( const uint8_t *  p)
staticnoexcept
Here is the caller graph for this function:

◆ LE32()

static uint32_t parser::LE32 ( const uint8_t *  p)
staticnoexcept
Here is the caller graph for this function:

◆ LE32s()

static int32_t parser::LE32s ( const uint8_t *  p)
staticnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LE32u()

static uint32_t parser::LE32u ( const uint8_t *  p)
staticnoexcept
Here is the caller graph for this function:

◆ LE64u()

static uint64_t parser::LE64u ( const uint8_t *  p)
staticnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MapType()

static EvlogTemplateField::Type parser::MapType ( const std::string &  t)
static
Here is the caller graph for this function:

◆ NormalizeKeyword()

static std::string parser::NormalizeKeyword ( const std::string &  s)
static
Here is the caller graph for this function:

◆ ParseFacility()

static int32_t parser::ParseFacility ( const std::string &  s)
static
Here is the caller graph for this function:

◆ ParseFieldDecl()

static std::optional< EvlogTemplateField > parser::ParseFieldDecl ( std::string  line)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseUint32()

static uint32_t parser::ParseUint32 ( const std::string &  s)
static
Here is the caller graph for this function:

◆ ReadId4()

static std::string parser::ReadId4 ( const uint8_t *  p)
static

Extract a null-padded 4-char ID (ECU/App/Ctx) as a trimmed std::string.

Here is the caller graph for this function:

◆ SeverityName()

static const char * parser::SeverityName ( int32_t  s)
staticnoexcept
Here is the caller graph for this function:

◆ StartElementHandler()

static void parser::StartElementHandler ( void *  userData,
const XML_Char *  name,
const XML_Char **  atts 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StripComment()

static std::string parser::StripComment ( const std::string &  line)
static
Here is the caller graph for this function:

◆ Trim()

static std::string parser::Trim ( const std::string &  s)
static
Here is the caller graph for this function:

◆ Unquote()

static std::string parser::Unquote ( const std::string &  s)
static
Here is the caller graph for this function:

Variable Documentation

◆ DLT_TYPE_LOG

constexpr uint8_t parser::DLT_TYPE_LOG = 0
staticconstexpr

◆ F_BOOT

constexpr uint32_t parser::F_BOOT = 0x04
staticconstexpr

◆ F_INTERRUPT

constexpr uint32_t parser::F_INTERRUPT = 0x10
staticconstexpr

◆ F_KERNEL

constexpr uint32_t parser::F_KERNEL = 0x02
staticconstexpr

◆ F_KERNTIME

constexpr uint32_t parser::F_KERNTIME = 0x08
staticconstexpr

◆ F_PRINTK

constexpr uint32_t parser::F_PRINTK = 0x20
staticconstexpr

◆ F_TRUNCATE

constexpr uint32_t parser::F_TRUNCATE = 0x01
staticconstexpr

◆ HTYP_MSBF

constexpr uint8_t parser::HTYP_MSBF = 0x02
staticconstexpr

◆ HTYP_UEH

constexpr uint8_t parser::HTYP_UEH = 0x01
staticconstexpr

◆ HTYP_WEID

constexpr uint8_t parser::HTYP_WEID = 0x04
staticconstexpr

◆ HTYP_WSID

constexpr uint8_t parser::HTYP_WSID = 0x08
staticconstexpr

◆ HTYP_WTMS

constexpr uint8_t parser::HTYP_WTMS = 0x10
staticconstexpr

◆ kHdrSize

constexpr size_t parser::kHdrSize = 60
staticconstexpr

◆ kLogLevels

const char* const parser::kLogLevels[]
static
Initial value:
= {
"Off", "Fatal", "Error", "Warn", "Info", "Debug", "Verbose"
}

◆ kMagic

constexpr uint8_t parser::kMagic[4] = {'D', 'L', 'T', 0x01}
staticconstexpr

◆ kMaxPayload

constexpr uint32_t parser::kMaxPayload = 64 * 1024
staticconstexpr

◆ kMaxSeverity

constexpr int32_t parser::kMaxSeverity = 7
staticconstexpr

◆ kMsgTypes

const char* const parser::kMsgTypes[]
static
Initial value:
= {
"Log", "AppTrace", "NwTrace", "Control"
}

◆ kOff_event_type

constexpr size_t parser::kOff_event_type = 12
staticconstexpr

◆ kOff_facility

constexpr size_t parser::kOff_facility = 16
staticconstexpr

◆ kOff_flags

constexpr size_t parser::kOff_flags = 48
staticconstexpr

◆ kOff_format

constexpr size_t parser::kOff_format = 8
staticconstexpr

◆ kOff_gid

constexpr size_t parser::kOff_gid = 28
staticconstexpr

◆ kOff_pid

constexpr size_t parser::kOff_pid = 32
staticconstexpr

◆ kOff_processor

constexpr size_t parser::kOff_processor = 56
staticconstexpr

◆ kOff_recid

constexpr size_t parser::kOff_recid = 0
staticconstexpr

◆ kOff_severity

constexpr size_t parser::kOff_severity = 20
staticconstexpr

◆ kOff_size

constexpr size_t parser::kOff_size = 4
staticconstexpr

◆ kOff_tv_nsec

constexpr size_t parser::kOff_tv_nsec = 44
staticconstexpr

◆ kOff_tv_sec

constexpr size_t parser::kOff_tv_sec = 40
staticconstexpr

◆ kOff_uid

constexpr size_t parser::kOff_uid = 24
staticconstexpr

◆ kProgressBatch [1/2]

constexpr size_t parser::kProgressBatch = 512
staticconstexpr

◆ kProgressBatch [2/2]

constexpr size_t parser::kProgressBatch = 512
staticconstexpr

◆ kStorageHdrSize

constexpr size_t parser::kStorageHdrSize = 16
staticconstexpr

◆ TI_BOOL

constexpr uint32_t parser::TI_BOOL = (1u << 4)
staticconstexpr

◆ TI_FLOA

constexpr uint32_t parser::TI_FLOA = (1u << 7)
staticconstexpr

◆ TI_RAWD

constexpr uint32_t parser::TI_RAWD = (1u << 10)
staticconstexpr

◆ TI_SINT

constexpr uint32_t parser::TI_SINT = (1u << 5)
staticconstexpr

◆ TI_STRG

constexpr uint32_t parser::TI_STRG = (1u << 9)
staticconstexpr

◆ TI_TYLE

constexpr uint32_t parser::TI_TYLE = 0x0000000Fu
staticconstexpr

◆ TI_UINT

constexpr uint32_t parser::TI_UINT = (1u << 6)
staticconstexpr

◆ TI_VARI

constexpr uint32_t parser::TI_VARI = (1u << 11)
staticconstexpr