mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-27 01:31:42 +00:00
Adds padding for all integer types.
This commit is contained in:
parent
95c68c76e1
commit
6805acd74f
@ -9,6 +9,7 @@
|
|||||||
#include "Struct.hpp"
|
#include "Struct.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
// MARK: - Setters
|
// MARK: - Setters
|
||||||
@ -150,7 +151,7 @@ std::string Reflection::Struct::description() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output Ints of all sizes as hex.
|
// Output Ints of all sizes as hex.
|
||||||
#define OutputIntC(int_type, cast_type) if(*type == typeid(int_type)) { stream << std::hex << cast_type(::Reflection::get<int_type>(*this, key)); continue; }
|
#define OutputIntC(int_type, cast_type) if(*type == typeid(int_type)) { stream << std::setfill('0') << std::setw(sizeof(int_type)*2) << std::hex << cast_type(::Reflection::get<int_type>(*this, key)); continue; }
|
||||||
#define OutputInt(int_type) OutputIntC(int_type, int_type)
|
#define OutputInt(int_type) OutputIntC(int_type, int_type)
|
||||||
OutputIntC(int8_t, int16_t);
|
OutputIntC(int8_t, int16_t);
|
||||||
OutputIntC(uint8_t, uint16_t);
|
OutputIntC(uint8_t, uint16_t);
|
||||||
|
Loading…
Reference in New Issue
Block a user