MeteoIODoc 20260428.5e5bc68a
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
mio::LinesRange Class Reference

Detailed Description

A class to represent and handle ranges of lines. They can be sorted, checked for uniqueness and a line number can be compared to the range (is it before or after?).

Author
Mathias Bavay

#include <IOInterface.h>

Public Member Functions

 LinesRange ()
 
 LinesRange (const size_t &l1, const size_t &l2)
 
bool in (const size_t &ll) const
 Is the provided line number within the current range?
 
bool operator< (const size_t &ll) const
 Is the provided line number before the end of the range?
 
bool operator> (const size_t &ll) const
 Is the provided line number after the start of the range?
 
bool operator< (const LinesRange &ll) const
 
bool operator== (const LinesRange &ll) const
 
const std::string toString () const
 

Static Public Member Functions

static std::vector< LinesRangegetLinesRestrictions (const std::string &args, const std::string &where, const bool &negate)
 built the set of line ranges to read or skip.
 

Public Attributes

size_t start
 
size_t end
 

Constructor & Destructor Documentation

◆ LinesRange() [1/2]

mio::LinesRange::LinesRange ( )
inline

◆ LinesRange() [2/2]

mio::LinesRange::LinesRange ( const size_t &  l1,
const size_t &  l2 
)
inline

Member Function Documentation

◆ getLinesRestrictions()

std::vector< LinesRange > mio::LinesRange::getLinesRestrictions ( const std::string &  args,
const std::string &  where,
const bool &  negate 
)
static

built the set of line ranges to read or skip.

Then each plugin is responsible to call this method if necessary and implement the lines skipping if necessary. Obviously this can not be implemented by every plugin! The line ranges are given as a comma delimited list of either single line numbers or ranges (line numbers delimited by a "-" character). Extra spaces can be given for more clarity in the input.

Parameters
[in]argsthe textual representation of the line ranges or lines to parse
[in]whereinformative string to describe which component it is in case of error messages (ex. "CSV plugin")
[in]negatetake the negation of the provided ranges (converting a "ONLY" statement into an "EXCLUDE" statement)
Returns
set of line ranges

◆ in()

bool mio::LinesRange::in ( const size_t &  ll) const
inline

Is the provided line number within the current range?

Parameters
[in]llline number to check
Returns
true if the line number is within the current range, false otherwise

◆ operator<() [1/2]

bool mio::LinesRange::operator< ( const LinesRange ll) const
inline

◆ operator<() [2/2]

bool mio::LinesRange::operator< ( const size_t &  ll) const
inline

Is the provided line number before the end of the range?

Parameters
[in]llline number to check
Returns
true if the line number is less than the end of the current range, false otherwise

◆ operator==()

bool mio::LinesRange::operator== ( const LinesRange ll) const
inline

◆ operator>()

bool mio::LinesRange::operator> ( const size_t &  ll) const
inline

Is the provided line number after the start of the range?

Parameters
[in]llline number to check
Returns
true if the line number is greater than the end of the current range, false otherwise

◆ toString()

const std::string mio::LinesRange::toString ( ) const
inline

Member Data Documentation

◆ end

size_t mio::LinesRange::end

◆ start

size_t mio::LinesRange::start

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