pdal::Extractor

class pdal::Extractor

Buffer wrapper for input of binary data from a buffer.

Subclassed by pdal::BeExtractor, pdal::LeExtractor, pdal::SwitchableExtractor

Public Functions

Extractor(const char *buf, std::size_t size)

Construct an extractor to operate on a buffer.

Parameters
  • buf: Buffer to extract from.
  • size: Buffer size.

operator bool()

Determine if the buffer is good.

Return
Whether the buffer is good.

void seek(std::size_t pos)

Seek to a position in the buffer.

Parameters
  • pos: Position to seek in buffer.

void skip(std::size_t cnt)

Advance buffer position.

Parameters
  • cnt: Number of bytes to skip in buffer.

size_t position() const

Return the get position of buffer.

Return
Get position.

bool good() const

Determine whether the extractor is good (the get pointer is in the buffer).

Return
Whether the get pointer is valid.

void get(std::string &s, size_t size)

Extract a string of a particular size from the buffer.

Trim trailing null bytes.

Parameters
  • s: String to extract to.
  • size: Number of bytes to extract from buffer into string.

void get(std::vector<char> &buf)

Extract data to char vector.

Vector must be sized to indicate number of bytes to extract.

Parameters
  • buf: Vector to which bytes should be extracted.

void get(std::vector<unsigned char> &buf)

Extract data to unsigned char vector.

Vector must be sized to indicate number of bytes to extract.

Parameters
  • buf: Vector to which bytes should be extracted.

void get(char *buf, size_t size)

Extract data into a provided buffer.

Parameters
  • buf: Pointer to buffer to which bytes should be extracted.
  • size: Number of bytes to extract.

void get(unsigned char *buf, size_t size)

Extract data into a provided unsigned buffer.

Parameters
  • buf: Pointer to buffer to which bytes should be extracted.
  • size: Number of bytes to extract.

virtual Extractor &operator>>(uint8_t &v) = 0
virtual Extractor &operator>>(int8_t &v) = 0
virtual Extractor &operator>>(uint16_t &v) = 0
virtual Extractor &operator>>(int16_t &v) = 0
virtual Extractor &operator>>(uint32_t &v) = 0
virtual Extractor &operator>>(int32_t &v) = 0
virtual Extractor &operator>>(uint64_t &v) = 0
virtual Extractor &operator>>(int64_t &v) = 0
virtual Extractor &operator>>(float &v) = 0
virtual Extractor &operator>>(double &v) = 0