ESA JPIP server
0.1
|
Identifies a data segment of a file. More...
#include <file_segment.h>
Public Member Functions | |
FileSegment () | |
Initializes all the member variables with zero, being a null segment. More... | |
FileSegment (uint64_t offset, uint64_t length) | |
Initializes the segment with the given parameters. More... | |
FileSegment (const FileSegment &segment) | |
Copy constructor. More... | |
FileSegment & | operator= (const FileSegment &segment) |
Copy assignment. More... | |
FileSegment & | RemoveFirst (int count) |
Removes the first bytes of the segment. More... | |
FileSegment & | RemoveLast (int count) |
Removes the last bytes of the segment. More... | |
bool | IsContiguousTo (const FileSegment &segment) const |
Returns true if the segment is contiguous to another given segment, so the first byte of the given segment is just the next byte after the last byte of the segment. More... | |
bool | operator== (const FileSegment &segment) const |
bool | operator!= (const FileSegment &segment) const |
template<typename T > | |
T & | SerializeWith (T &stream) |
virtual | ~FileSegment () |
Public Attributes | |
uint64_t | offset |
Offset of the data segment. More... | |
uint64_t | length |
Length of the data segment. More... | |
Static Public Attributes | |
static const FileSegment | Null |
Identifies a null segment, with the offset as well as the length set to zero. More... | |
Friends | |
ostream & | operator<< (ostream &out, const FileSegment &segment) |
Identifies a data segment of a file.
This segment is defined by an offset and a length (number of bytes), both of them with an unsigned integer of 64 bits. This class is serializable and can be printed.
|
inline |
Initializes all the member variables with zero, being a null segment.
|
inline |
Initializes the segment with the given parameters.
offset | Offset of the segment. |
length | Length of the segment. |
|
inline |
Copy constructor.
|
inlinevirtual |
|
inline |
Returns true
if the segment is contiguous to another given segment, so the first byte of the given segment is just the next byte after the last byte of the segment.
|
inline |
|
inline |
Copy assignment.
|
inline |
|
inline |
Removes the first bytes of the segment.
Modifies the segment as if a number of bytes (specified by the parameter) was removed from the beginning of the segment.
count | Number of bytes to remove. |
*this
.
|
inline |
Removes the last bytes of the segment.
Modifies the segment as if a number of bytes (specified by the parameter) was removed from the end of the segment.
count | Number of bytes to remove. |
*this
.
|
inline |
|
friend |
uint64_t data::FileSegment::length |
Length of the data segment.
|
static |
Identifies a null segment, with the offset as well as the length set to zero.
uint64_t data::FileSegment::offset |
Offset of the data segment.