DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
fileDetails.hpp
Go to the documentation of this file.
1// Copyright (c) 2020-2025 Cody R. Drisko. All rights reserved.
2// Licensed under the MIT License. See the LICENSE file in the project root for more information.
3//
4// Name: fileDetails.hpp
5// Author: crdrisko
6// Date: 12/30/2020-08:58:21
7// Description: Details to be used with the testing of the files library
8
9#ifndef DRYCHEM_COMMON_UTILITIES_LIBS_FILES_TESTS_DETAILS_FILEDETAILS_HPP
10#define DRYCHEM_COMMON_UTILITIES_LIBS_FILES_TESTS_DETAILS_FILEDETAILS_HPP
11
12#include <cstddef>
13#include <filesystem>
14#include <fstream>
15
16namespace fs = std::filesystem;
17
19{
20 void createOutputFile(const fs::path& fileName, char separator)
21 {
22 std::ofstream outFile {fileName};
23
24 for (std::size_t i {1}; i < 13; ++i)
25 {
26 outFile << i;
27
28 if (i % 3 == 0)
29 outFile << '\n';
30 else
31 outFile << separator;
32 }
33 }
34} // namespace CppUtils::Files::details::testing
35
36#endif
Definition fileDetails.hpp:19
void createOutputFile(const fs::path &fileName, char separator)
Definition fileDetails.hpp:20