MCPcopy Create free account
hub / github.com/PDAL/PDAL / IBeStream

Class IBeStream

pdal/util/IStream.hpp:438–592  ·  view source on GitHub ↗

Stream wrapper for input of binary data that converts from big-endian to host ordering. */

Source from the content-addressed store, hash-verified

436 to host ordering.
437*/
438class IBeStream : public IStream
439{
440public:
441 /**
442 Default constructor.
443 */
444 PDAL_EXPORT IBeStream()
445 {}
446
447 /**
448 Constructor that opens the file and maps it to a stream.
449
450 \param filename Filename.
451 */
452 PDAL_EXPORT IBeStream(const std::string& filename) : IStream(filename)
453 {}
454
455 /**
456 Constructor that maps to a provided stream.
457
458 \param stream Stream to extract from.
459 */
460 PDAL_EXPORT IBeStream(std::istream *stream) : IStream(stream)
461 {}
462
463 /**
464 Extract an unsigned byte from the stream.
465
466 \param v unsigned byte to populate
467 \return This stream.
468 */
469 PDAL_EXPORT IBeStream& operator >> (uint8_t& v)
470 {
471 v = (uint8_t)m_stream->get();
472 return *this;
473 }
474
475 /**
476 Extract an unsigned byte from the stream.
477
478 \param v unsigned byte to populate
479 \return This stream.
480 */
481 PDAL_EXPORT IBeStream& operator >> (int8_t& v)
482 {
483 v = (int8_t)m_stream->get();
484 return *this;
485 }
486
487 /**
488 Extract an unsigned short from the stream.
489
490 \param v unsigned short to populate
491 \return This stream.
492 */
493 PDAL_EXPORT IBeStream& operator >> (uint16_t& v)
494 {
495 m_stream->read((char *)&v, sizeof(v));

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected