MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mio::FileUtils::FileIndexer Class Reference

#include <FileUtils.h>

Public Member Functions

 FileIndexer ()
 
void setIndex (const Date &i_date, const std::streampos &i_pos)
 Add a new position to the index. More...
 
void setIndex (const std::string &i_date, const std::streampos &i_pos)
 
void setIndex (const double &i_date, const std::streampos &i_pos)
 
std::streampos getIndex (const Date &i_date) const
 Get the file position suitable for a given date. More...
 
std::streampos getIndex (const std::string &i_date) const
 
std::streampos getIndex (const double &i_date) const
 
const std::string toString () const
 

Constructor & Destructor Documentation

mio::FileUtils::FileIndexer::FileIndexer ( )
inline

Member Function Documentation

std::streampos mio::FileUtils::FileIndexer::getIndex ( const Date i_date) const

Get the file position suitable for a given date.

Parameters
[in]i_datedate for which a position is requested
Returns
closest streampos position before the requested date, -1 if nothing could be found (empty index)
std::streampos mio::FileUtils::FileIndexer::getIndex ( const std::string &  i_date) const
std::streampos mio::FileUtils::FileIndexer::getIndex ( const double &  i_date) const
void mio::FileUtils::FileIndexer::setIndex ( const Date i_date,
const std::streampos &  i_pos 
)

Add a new position to the index.

Parameters
[in]i_datedate of the new position
[in]i_posstreampos position
void mio::FileUtils::FileIndexer::setIndex ( const std::string &  i_date,
const std::streampos &  i_pos 
)
void mio::FileUtils::FileIndexer::setIndex ( const double &  i_date,
const std::streampos &  i_pos 
)
const std::string mio::FileUtils::FileIndexer::toString ( ) const

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