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

#include "PyDumpVisitor.h"

Inheritance diagram for PyFileDumpVisitor:
Collaboration diagram for PyFileDumpVisitor:

Public Member Functions

 PyFileDumpVisitor (FILE *_file, const char *pfx="", bool full_nested=false, bool full_hex=false)
 
bool fullHex () const
 
FILE * file () 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
 
FILE *const mFile
 

Additional Inherited Members

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

Detailed Description

Definition at line 94 of file PyDumpVisitor.h.

Constructor & Destructor Documentation

PyFileDumpVisitor::PyFileDumpVisitor ( FILE *  _file,
const char *  pfx = "",
bool  full_nested = false,
bool  full_hex = false 
)

Definition at line 365 of file PyDumpVisitor.cpp.

366 : PyDumpVisitor( pfx, full_nested ),
367  mFullHex( full_hex ),
368  mFile( _file )
369 {
370 }
PyDumpVisitor(const char *pfx="", bool full_nested=false)
const bool mFullHex
FILE *const mFile

Member Function Documentation

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

Implements PyDumpVisitor.

Definition at line 383 of file PyDumpVisitor.cpp.

References file(), fullHex(), pfxHexDump(), and pfxHexDumpPreview().

384 {
385  if (fullHex())
386  pfxHexDump( pfx, file(), data, len );
387  else
388  pfxHexDumpPreview( pfx, file(), data, len );
389 }
bool fullHex() const
Definition: PyDumpVisitor.h:99
void pfxHexDump(const char *pfx, FILE *into, const uint8 *data, size_t length)
Definition: utils_hex.cpp:63
FILE * file() const
void pfxHexDumpPreview(const char *pfx, FILE *into, const uint8 *data, size_t length)
Definition: utils_hex.cpp:87

Here is the call graph for this function:

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

Implements PyDumpVisitor.

Definition at line 372 of file PyDumpVisitor.cpp.

References file().

373 {
374  va_list ap;
375  va_start( ap, fmt );
376 
377  vfprintf( file(), fmt, ap );
378  fprintf( file(), "\n" );
379 
380  va_end( ap );
381 }
FILE * file() const

Here is the call graph for this function:

FILE* PyFileDumpVisitor::file ( ) const
inline

Definition at line 101 of file PyDumpVisitor.h.

References mFile.

Referenced by _dump(), and _print().

101 { return mFile; }
FILE *const mFile

Here is the caller graph for this function:

bool PyFileDumpVisitor::fullHex ( ) const
inline

Definition at line 99 of file PyDumpVisitor.h.

References mFullHex.

Referenced by _dump().

99 { return mFullHex; }
const bool mFullHex

Here is the caller graph for this function:

Member Data Documentation

FILE* const PyFileDumpVisitor::mFile
private

Definition at line 110 of file PyDumpVisitor.h.

Referenced by file().

const bool PyFileDumpVisitor::mFullHex
private

Definition at line 108 of file PyDumpVisitor.h.

Referenced by fullHex().


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