Added data_streamer constructor with byte order

This commit is contained in:
Bob Polis 2021-11-04 23:01:21 +01:00
parent d709abce47
commit 583b5bb2b9
2 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,8 @@ using namespace sc::io;
// data_streamer ---------------------------------------------------------------
data_streamer::data_streamer(byte_order bo) : _target_byte_order(bo) {}
byte_order data_streamer::cur_byte_order() {
uint8_t ch[2] = {0x12, 0x34};
uint16_t* p = reinterpret_cast<uint16_t*>(ch);

View File

@ -223,6 +223,7 @@ namespace sc {
}
data_streamer() = default;
data_streamer(byte_order bo);
byte_order target_byte_order() const { return _target_byte_order; }
void target_byte_order(byte_order new_byte_order) { _target_byte_order = new_byte_order; }