summaryrefslogtreecommitdiff
path: root/src/utils/general.hpp
blob: dbdbdfcf6aa9fd1d7c6f88cc284b97c1c626310a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include "memory.hpp"
#include "smart_string.hpp"

/**
 * Stops code execution.
 */
void stop();

/**
 * Converts a double number to a string.
 *
 * @param num A double number
 * @param width The desired double width
 * @param precision The desired double precision
 * @returns The double as a string.
 */
UniquePtr<SmartString> doubleToStr(double num, unsigned int width = 3,
								   unsigned int precision = 2);

/**
 * Converts a integer to a string.
 *
 * @param num A number
 * @returns The number as a string.
 */
UniquePtr<SmartString> intToStr(int num);

/**
 * Converts a unsigned integer to a string.
 *
 * @param num A number
 * @returns The number as a string.
 */
UniquePtr<SmartString> uintToStr(unsigned int num);