| 60 | |
| 61 | template<typename ValueType> |
| 62 | void FormatToStream(MemoryOutStream& stream, char const* format, ValueType const& value) |
| 63 | { |
| 64 | using namespace std; |
| 65 | |
| 66 | const size_t BUFFER_SIZE=32; |
| 67 | char txt[BUFFER_SIZE]; |
| 68 | snprintf(txt, BUFFER_SIZE, format, value); |
| 69 | stream << txt; |
| 70 | } |
| 71 | |
| 72 | int RoundUpToMultipleOfPow2Number (int n, int pow2Number) |
| 73 | { |