Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cLogFileTail Class Reference

#include <cLogFileTail.h>

Inheritance diagram for GrayLib::cLogFileTail:
Gray::cRefBase IUnknown

Public Member Functions

 cLogFileTail (cStringF sFilePath, STREAM_POS_t nPos=0)
 
virtual ~cLogFileTail ()
 
cStringF get_Name () const
 
HRESULT ReadLogFile (cStreamOutput *pOut, size_t nPollSizeMax)
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 

Public Attributes

cStringF m_sFilePath
 a full path to a log file to tail. More...
 
STREAM_POS_t m_nPos
 last position read. More...
 
cTimeInt m_timeChange
 Last Change to file. More...
 
cTimeInt m_timeLastCheck
 Last check. More...
 
bool m_bReady
 Change Signaled or Assume data is ready now. Don't wait for event. More...
 

Detailed Description

Tail a single file. Should also use cFileChangeWatch/INotify for long duration waits?

Constructor & Destructor Documentation

◆ cLogFileTail()

GrayLib::cLogFileTail::cLogFileTail ( cStringF  sFilePath,
STREAM_POS_t  nPos = 0 
)

◆ ~cLogFileTail()

GrayLib::cLogFileTail::~cLogFileTail ( )
virtual

Member Function Documentation

◆ get_Name()

cStringF GrayLib::cLogFileTail::get_Name ( ) const
inline

◆ ReadLogFile()

HRESULT GrayLib::cLogFileTail::ReadLogFile ( cStreamOutput pOut,
size_t  nPollSizeMax 
)

Tail the file out to pOut for a max amount of nPollTimeMax and nPollSizeMax. If the file has been shortened. just reset to beginning. Ignore internal edits to file.

Returns
# of line changes detected.

Member Data Documentation

◆ m_bReady

bool GrayLib::cLogFileTail::m_bReady

Change Signaled or Assume data is ready now. Don't wait for event.

◆ m_nPos

STREAM_POS_t GrayLib::cLogFileTail::m_nPos

last position read.

◆ m_sFilePath

cStringF GrayLib::cLogFileTail::m_sFilePath

a full path to a log file to tail.

◆ m_timeChange

cTimeInt GrayLib::cLogFileTail::m_timeChange

Last Change to file.

◆ m_timeLastCheck

cTimeInt GrayLib::cLogFileTail::m_timeLastCheck

Last check.


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