#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); // -------------------------------------------------------------------------------------------- // }