Consolix
Loading...
Searching...
No Matches
test_strip_json_comments.cpp File Reference
#include <iostream>
#include <fstream>
#include <string>
#include <stdexcept>
#include <consolix/utils/json_utils.hpp>
#include <consolix/utils/path_utils.hpp>

Go to the source code of this file.

Functions

std::string read_file (const std::string &file_path)
 Читает содержимое файла в строку.
 
void write_file (const std::string &file_path, const std::string &content)
 Записывает строку в файл.
 
int main ()
 

Function Documentation

◆ main()

int main ( )

◆ read_file()

std::string read_file ( const std::string & file_path)

Читает содержимое файла в строку.

Parameters
file_pathПуть к файлу.
Returns
Содержимое файла как строка.
Exceptions
std::runtime_errorЕсли файл не удалось открыть.

Definition at line 12 of file test_strip_json_comments.cpp.

◆ write_file()

void write_file ( const std::string & file_path,
const std::string & content )

Записывает строку в файл.

Parameters
file_pathПуть к файлу.
contentСтрока для записи.
Exceptions
std::runtime_errorЕсли файл не удалось открыть.

Definition at line 24 of file test_strip_json_comments.cpp.