Newer
Older
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
37
38
39
#pragma once
// [io-guts.h]
// -------------------------------------------------------------------------------------------- //
// input/output tech subroutines
// -------------------------------------------------------------------------------------------- //
#include <string>
namespace scm
{
// append index to string before last '.'
// -------------------------------------------------------------------------------------------- //
const std::string append_index(const std::string& name, const int index);
// -------------------------------------------------------------------------------------------- //
// create all directories in path
// --- returns <true> on create and if exists
// -------------------------------------------------------------------------------------------- //
bool create_dir(const std::string& path);
// -------------------------------------------------------------------------------------------- //
// fgets() for arbitrary line length
// --- <buf> - pointer to buffer memory (input/output)
// --- <size> - buffer memory size (input/output)
// -------------------------------------------------------------------------------------------- //
char* getline(char** buf, int* size, FILE* ptr);
// -------------------------------------------------------------------------------------------- //
// convert int to string
// *: implemented due to problems with std::to_string on some gcc compilers
// -------------------------------------------------------------------------------------------- //
std::string convert_to_string(const int value);
std::string convert_to_string(const double value);
// -------------------------------------------------------------------------------------------- //
}