EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PyLogDumpVisitor Class Reference

#include "PyDumpVisitor.h"

Inheritance diagram for PyLogDumpVisitor:
Collaboration diagram for PyLogDumpVisitor:

Public Member Functions

 PyLogDumpVisitor (LogType log_type, LogType log_hex_type, const char *pfx="", bool full_nested=false, bool full_hex=false)
 
bool fullHex () const
 
LogType logType () const
 
LogType logHexType () const
 
- Public Member Functions inherited from PyDumpVisitor
 PyDumpVisitor (const char *pfx="", bool full_nested=false)
 
bool fullNested () const
 
- Public Member Functions inherited from PyPfxVisitor
 PyPfxVisitor (const char *pfx="")
 
- Public Member Functions inherited from PyVisitor
virtual ~PyVisitor ()
 

Protected Member Functions

void _print (const char *fmt,...)
 
void _dump (const char *pfx, const uint8 *data, size_t len)
 
- Protected Member Functions inherited from PyDumpVisitor
bool VisitInteger (const PyInt *rep)
 primitive data visitors More...
 
bool VisitLong (const PyLong *rep)
 
bool VisitReal (const PyFloat *rep)
 
bool VisitBoolean (const PyBool *rep)
 
bool VisitNone (const PyNone *rep)
 
bool VisitBuffer (const PyBuffer *rep)
 
bool VisitString (const PyString *rep)
 
bool VisitWString (const PyWString *rep)
 
bool VisitToken (const PyToken *rep)
 
bool VisitTuple (const PyTuple *rep)
 the nested types Visitor More...
 
bool VisitList (const PyList *rep)
 
bool VisitDict (const PyDict *rep)
 
bool VisitObject (const PyObject *rep)
 Object type visitor. More...
 
bool VisitObjectEx (const PyObjectEx *rep)
 
bool VisitPackedRow (const PyPackedRow *rep)
 PackedRow type visitor. More...
 
bool VisitSubStruct (const PySubStruct *rep)
 wrapper types Visitor More...
 
bool VisitSubStream (const PySubStream *rep)
 
bool VisitChecksumedStream (const PyChecksumedStream *rep)
 
- Protected Member Functions inherited from PyPfxVisitor
const char * _pfx () const
 
void _pfxExtend (const char *fmt,...)
 
void _pfxWithdraw ()
 

Private Attributes

const bool mFullHex
 
const LogType mLogType
 
const LogType mLogHexType
 

Additional Inherited Members

- Protected Attributes inherited from PyPfxVisitor
std::stack< std::string > mPfxStack
 

Detailed Description

Definition at line 73 of file PyDumpVisitor.h.

Constructor & Destructor Documentation

PyLogDumpVisitor::PyLogDumpVisitor ( LogType  log_type,
LogType  log_hex_type,
const char *  pfx = "",
bool  full_nested = false,
bool  full_hex = false 
)

Definition at line 333 of file PyDumpVisitor.cpp.

334 : PyDumpVisitor( pfx, full_nested ),
335  mFullHex( full_hex ),
336  mLogType( log_type ),
337  mLogHexType( log_hex_type )
338 {
339 }
PyDumpVisitor(const char *pfx="", bool full_nested=false)
const LogType mLogType
Definition: PyDumpVisitor.h:90
const LogType mLogHexType
Definition: PyDumpVisitor.h:91
const bool mFullHex
Definition: PyDumpVisitor.h:88

Member Function Documentation

void PyLogDumpVisitor::_dump ( const char *  pfx,
const uint8 data,
size_t  len 
)
protectedvirtual

Implements PyDumpVisitor.

Definition at line 354 of file PyDumpVisitor.cpp.

References fullHex(), is_log_enabled, logHexType(), pfxHexDump(), and pfxHexDumpPreview().

355 {
356  if (!is_log_enabled( logHexType() ) )
357  return;
358 
359  if (fullHex() )
360  pfxHexDump( pfx, logHexType(), data, len );
361  else
362  pfxHexDumpPreview( pfx, logHexType(), data, len );
363 }
bool fullHex() const
Definition: PyDumpVisitor.h:78
void pfxHexDump(const char *pfx, FILE *into, const uint8 *data, size_t length)
Definition: utils_hex.cpp:63
#define is_log_enabled(type)
Definition: logsys.h:78
void pfxHexDumpPreview(const char *pfx, FILE *into, const uint8 *data, size_t length)
Definition: utils_hex.cpp:87
LogType logHexType() const
Definition: PyDumpVisitor.h:81

Here is the call graph for this function:

void PyLogDumpVisitor::_print ( const char *  fmt,
  ... 
)
protectedvirtual

Implements PyDumpVisitor.

Definition at line 341 of file PyDumpVisitor.cpp.

References is_log_enabled, log_messageVA(), and logType().

Referenced by PyLookupDumpVisitor::VisitInteger(), and PyLookupDumpVisitor::VisitString().

342 {
343  if (!is_log_enabled( logType() ) )
344  return;
345 
346  va_list ap;
347  va_start( ap, fmt );
348 
349  log_messageVA( logType(), fmt, ap );
350 
351  va_end( ap );
352 }
#define is_log_enabled(type)
Definition: logsys.h:78
LogType logType() const
Definition: PyDumpVisitor.h:80
void log_messageVA(LogType type, const char *fmt, va_list args)
Definition: logsys.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

bool PyLogDumpVisitor::fullHex ( ) const
inline

Definition at line 78 of file PyDumpVisitor.h.

References mFullHex.

Referenced by _dump().

78 { return mFullHex; }
const bool mFullHex
Definition: PyDumpVisitor.h:88

Here is the caller graph for this function:

LogType PyLogDumpVisitor::logHexType ( ) const
inline

Definition at line 81 of file PyDumpVisitor.h.

References mLogHexType.

Referenced by _dump().

81 { return mLogHexType; }
const LogType mLogHexType
Definition: PyDumpVisitor.h:91

Here is the caller graph for this function:

LogType PyLogDumpVisitor::logType ( ) const
inline

Definition at line 80 of file PyDumpVisitor.h.

References mLogType.

Referenced by _print().

80 { return mLogType; }
const LogType mLogType
Definition: PyDumpVisitor.h:90

Here is the caller graph for this function:

Member Data Documentation

const bool PyLogDumpVisitor::mFullHex
private

Definition at line 88 of file PyDumpVisitor.h.

Referenced by fullHex().

const LogType PyLogDumpVisitor::mLogHexType
private

Definition at line 91 of file PyDumpVisitor.h.

Referenced by logHexType().

const LogType PyLogDumpVisitor::mLogType
private

Definition at line 90 of file PyDumpVisitor.h.

Referenced by logType().


The documentation for this class was generated from the following files: