Politician 1.0.0
WiFi Auditing Library for ESP32
Loading...
Searching...
No Matches
politician::storage::Hc22000FileLogger Class Reference

Helper for writing HandshakeRecords to an HC22000 text file. More...

#include <PoliticianStorage.h>

Public Member Functions

 Hc22000FileLogger ()
 
 ~Hc22000FileLogger ()
 
bool open (fs::FS &fs, const char *path)
 Opens the HC22000 file for streaming writes.
 
bool write (const HandshakeRecord &rec)
 Writes a HandshakeRecord to the open file.
 
void close ()
 Closes the underlying file handle.
 
bool isOpen () const
 Returns true if the file is currently open for streaming.
 

Static Public Member Functions

static bool append (fs::FS &fs, const char *path, const HandshakeRecord &rec)
 Appends a HandshakeRecord to a file as an HC22000 string (opens and closes per call).
 

Detailed Description

Helper for writing HandshakeRecords to an HC22000 text file.

Supports both streaming (open/write/close) and one-shot (static append()) usage.

Definition at line 144 of file PoliticianStorage.h.

Constructor & Destructor Documentation

◆ Hc22000FileLogger()

politician::storage::Hc22000FileLogger::Hc22000FileLogger ( )
inline

Definition at line 146 of file PoliticianStorage.h.

◆ ~Hc22000FileLogger()

politician::storage::Hc22000FileLogger::~Hc22000FileLogger ( )
inline

Definition at line 148 of file PoliticianStorage.h.

References close().

Member Function Documentation

◆ append()

static bool politician::storage::Hc22000FileLogger::append ( fs::FS &  fs,
const char *  path,
const HandshakeRecord rec 
)
inlinestatic

Appends a HandshakeRecord to a file as an HC22000 string (opens and closes per call).

Prefer the streaming API (open/write/close) for continuous capture.

Definition at line 185 of file PoliticianStorage.h.

References open(), and write().

◆ close()

void politician::storage::Hc22000FileLogger::close ( )
inline

Closes the underlying file handle.

Safe to call multiple times.

Definition at line 174 of file PoliticianStorage.h.

Referenced by open(), and ~Hc22000FileLogger().

◆ isOpen()

bool politician::storage::Hc22000FileLogger::isOpen ( ) const
inline

Returns true if the file is currently open for streaming.

Definition at line 179 of file PoliticianStorage.h.

◆ open()

bool politician::storage::Hc22000FileLogger::open ( fs::FS &  fs,
const char *  path 
)
inline

Opens the HC22000 file for streaming writes.

Returns
true if successful

Definition at line 154 of file PoliticianStorage.h.

References close().

Referenced by append().

◆ write()

bool politician::storage::Hc22000FileLogger::write ( const HandshakeRecord rec)
inline

Writes a HandshakeRecord to the open file.

Returns
true if data was written

Definition at line 166 of file PoliticianStorage.h.

References politician::format::toHC22000().

Referenced by append().


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