diff options
author | Karel Kočí <cynerd@email.cz> | 2017-08-30 21:37:53 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-08-30 21:42:02 +0200 |
commit | 9cf92379d5fcf0076c25dae0935daab446c992cd (patch) | |
tree | dd09a2e996db1e5a8117f01bec76f1e93eaca6e1 /qtmips_machine/utils.cpp | |
download | qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.gz qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.bz2 qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.zip |
Initial commit
Adding work done so far.
Diffstat (limited to 'qtmips_machine/utils.cpp')
-rw-r--r-- | qtmips_machine/utils.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/qtmips_machine/utils.cpp b/qtmips_machine/utils.cpp new file mode 100644 index 0000000..dfe8c2a --- /dev/null +++ b/qtmips_machine/utils.cpp @@ -0,0 +1,30 @@ +#include "utils.h" +#include <sstream> + +#define TO_STR_HEX do { std::stringstream ss; ss << std::hex << v; return std::string(ss.str()); } while (false) + +std::string to_string_hex(int v) { + TO_STR_HEX; +} + +std::string to_string_hex(unsigned v) { + TO_STR_HEX; +} + +std::string to_string_hex(long v) { + TO_STR_HEX; +} + +std::string to_string_hex(unsigned long v) { + TO_STR_HEX; +} + +std::string to_string_hex(long long v) { + TO_STR_HEX; +} + +std::string to_string_hex(unsigned long long v) { + TO_STR_HEX; +} + +#undef TO_STR_HEX |