Torch
Loading...
Searching...
No Matches
TorchUtils.h
1#pragma once
2
3#include <string>
4#include <vector>
5#include <fstream>
6#include <sstream>
7#include <iomanip>
8#include <cstdint>
9#include <algorithm>
10#include <filesystem>
11
12namespace Torch {
13template< typename T >
14std::string to_hex(T number, const bool append0x = true) {
15 std::stringstream stream;
16 if(append0x) {
17 stream << "0x";
18 }
19 stream << std::setfill ('0')
20 << std::hex << number;
21
22 auto format = stream.str();
23 std::transform(format.begin(), format.end(), format.begin(), ::toupper);
24 return format;
25}
26
27uint32_t translate(uint32_t offset);
28std::vector<std::filesystem::directory_entry> getRecursiveEntries(const std::filesystem::path baseDir);
29
30};