XamShowMessageBoxUI (that auto-advances).

This commit is contained in:
Ben Vanik
2014-08-04 20:24:08 -07:00
parent 66d2a8aec2
commit 64d8ee386b
7 changed files with 137 additions and 1 deletions

View File

@@ -10,6 +10,8 @@
#ifndef POLY_MEMORY_H_
#define POLY_MEMORY_H_
#include <string>
#include <poly/byte_order.h>
namespace poly {
@@ -101,6 +103,32 @@ template <>
inline double load_and_swap<double>(const void* mem) {
return byte_swap(*reinterpret_cast<const double*>(mem));
}
template <>
inline std::string load_and_swap<std::string>(const void* mem) {
std::string value;
for (int i = 0;; ++i) {
auto c =
poly::load_and_swap<uint8_t>(reinterpret_cast<const uint8_t*>(mem) + i);
if (!c) {
break;
}
value.push_back(static_cast<char>(c));
}
return value;
}
template <>
inline std::wstring load_and_swap<std::wstring>(const void* mem) {
std::wstring value;
for (int i = 0;; ++i) {
auto c = poly::load_and_swap<uint16_t>(
reinterpret_cast<const uint16_t*>(mem) + i);
if (!c) {
break;
}
value.push_back(static_cast<wchar_t>(c));
}
return value;
}
template <typename T>
void store(void* mem, T value);