Disk ARchive  2.7.15
Full featured and portable backup and archiving tool
Public Member Functions | Private Attributes | List of all members
libdar::range Class Reference

stores a range of integers or a set of ranges More...

#include <range.hpp>

+ Collaboration diagram for libdar::range:

Public Member Functions

 range (const infinint &low, const infinint &high)
 
 range (const range &ref)=default
 
 range (range &&ref) noexcept=default
 
rangeoperator= (const range &ref)=default
 
rangeoperator= (range &&ref) noexcept=default
 
void operator+= (const range &ref)
 
range operator+ (const range &ref) const
 
std::string display () const
 
void reset_read () const
 provides a way to read range contents segment by segment More...
 
bool read_next_segment (infinint &low, infinint &high) const
 read the next available segment More...
 
void clear ()
 

Private Attributes

std::list< segment > parts
 
std::list< segment >::const_iterator read_cursor
 

Detailed Description

stores a range of integers or a set of ranges

Definition at line 43 of file range.hpp.

Member Function Documentation

◆ read_next_segment()

bool libdar::range::read_next_segment ( infinint low,
infinint high 
) const

read the next available segment

Parameters
[out]lowwhen read_next_segment() returns true, contains the low value of the next segment
[out]highwhen read_next_segment() returns true, contains the high value of the next segment
Returns
true and set the low and high value when a next segment is available in the range, returns false if all segment have been read low and high are not modified in that case.

◆ reset_read()

void libdar::range::reset_read ( ) const
inline

provides a way to read range contents segment by segment

Note
reset_read() is to be called once then read_next_segment() will return true for each new segment giving in argument its low and high value when no more segment are available it returns false, reset_read() can be call at any time to reset the reading operation

Definition at line 64 of file range.hpp.


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