MOOS

CMOOSMemMappedTextFile< T > Class Template Reference

#include <MOOSMemoryMapped.h>

List of all members.

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< LINEm_LineIndex
int m_nLineCount


Detailed Description

template<class T = TextLineInfo>
class CMOOSMemMappedTextFile< T >

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"


Member Typedef Documentation

template<class T = TextLineInfo>
typedef T CMOOSMemMappedTextFile< T >::LINE
 

we will refer to T as type LINE


Constructor & Destructor Documentation

template<class T = TextLineInfo>
CMOOSMemMappedTextFile< T >::CMOOSMemMappedTextFile  )  [inline]
 

constructor counts lines and buld line index


Member Function Documentation

template<class T = TextLineInfo>
bool CMOOSMemMappedTextFile< T >::BuildLineIndex int  nNumLines = -1  )  [inline]
 

iterate through the file building the line index

template<class T = TextLineInfo>
std::string CMOOSMemMappedTextFile< T >::GetLine int  nLine  )  [inline]
 

return the specified line as a string

template<class T = TextLineInfo>
int CMOOSMemMappedTextFile< T >::GetLineCount  )  [inline]
 

simply returns size of file in lines looking for


Member Data Documentation

template<class T = TextLineInfo>
std::vector< LINE > CMOOSMemMappedTextFile< T >::m_LineIndex
 

a vector of LINES (templated type).

template<class T = TextLineInfo>
int CMOOSMemMappedTextFile< T >::m_nLineCount
 

how many lines we have


The documentation for this class was generated from the following file:
Generated on Tue Mar 13 10:23:13 2007 for MOOSGenLib by  doxygen 1.4.6