MOOS 0.2375
|
#include <MOOSMemoryMapped.h>
Public Types | |
typedef T | LINE |
Public Member Functions | |
CMOOSMemMappedTextFile () | |
bool | Open (const std::string &sName, int nMaxLines=-1) |
int | GetLineCount () |
bool | BuildLineIndex (int nNumLines=-1) |
std::string | GetLine (int nLine) |
Public Attributes | |
std::vector< LINE > | m_LineIndex |
int | m_nLineCount |
Specialised memory mapped file class to handle text files.
Default template parameter is type TextLineInfo. Other template types must support the following functions: T::T(char * pStart, char * pEnd) //constructor char * T.Start(); //return start of line char * T.End(); //return end of line bool IsWanted(); //return true if this line is wanted
Main functionality of this class is to produce a index of lines each entry pointing to a instance of "T"
Definition at line 259 of file MOOSMemoryMapped.h.
typedef T CMOOSMemMappedTextFile< T >::LINE |
we will refer to T as type LINE
Definition at line 266 of file MOOSMemoryMapped.h.
CMOOSMemMappedTextFile< T >::CMOOSMemMappedTextFile | ( | ) | [inline] |
constructor counts lines and buld line index
Definition at line 269 of file MOOSMemoryMapped.h.
bool CMOOSMemMappedTextFile< T >::BuildLineIndex | ( | int | nNumLines = -1 | ) | [inline] |
iterate through the file building the line index
Definition at line 318 of file MOOSMemoryMapped.h.
std::string CMOOSMemMappedTextFile< T >::GetLine | ( | int | nLine | ) | [inline] |
return the specified line as a string
Definition at line 358 of file MOOSMemoryMapped.h.
int CMOOSMemMappedTextFile< T >::GetLineCount | ( | ) | [inline] |
simply returns size of file in lines looking for
Definition at line 287 of file MOOSMemoryMapped.h.
bool CMOOSMemMappedTextFile< T >::Open | ( | const std::string & | sName, |
int | nMaxLines = -1 |
||
) | [inline] |
Definition at line 271 of file MOOSMemoryMapped.h.
std::vector< LINE > CMOOSMemMappedTextFile< T >::m_LineIndex |
a vector of LINES (templated type).
Definition at line 371 of file MOOSMemoryMapped.h.
int CMOOSMemMappedTextFile< T >::m_nLineCount |
how many lines we have
Definition at line 374 of file MOOSMemoryMapped.h.