| // Copyright 2024 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| #pragma once |
| |
| #include <filesystem> |
| #include <string> |
| #include <vector> |
| |
| namespace google |
| { |
| namespace hoth |
| { |
| namespace internal |
| { |
| |
| namespace fs = std::filesystem; |
| |
| /** |
| * Returns a list of paths in a directory |
| * |
| * TODO: Can be dropped if we implement a clean fs wrapper for test injection. |
| * |
| * @param[in] path - the path to search |
| * @return a list of paths in the given directory |
| */ |
| std::vector<fs::path> listDir(const fs::path& path); |
| |
| /** |
| * Returns the first line of a file as a string |
| * |
| * TODO: Can be dropped if we implement a clean fs wrapper for test injection. |
| * |
| * @param[in] path - the path of a file |
| * @return a string containing the first line of the file |
| */ |
| std::string getFirstLine(const fs::path& path); |
| |
| } // namespace internal |
| |
| } // namespace hoth |
| |
| } // namespace google |