Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 1 | // Copyright 2023 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BSSL_FILLINS_PATH_SERVICE_H |
| 6 | #define BSSL_FILLINS_PATH_SERVICE_H |
| 7 | |
| 8 | #include <openssl/base.h> |
| 9 | |
| 10 | #include <string> |
| 11 | |
| 12 | namespace bssl { |
| 13 | |
| 14 | namespace fillins { |
| 15 | |
Bob Beck | 85081c6 | 2023-08-28 21:25:30 +0000 | [diff] [blame] | 16 | class FilePath { |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 17 | public: |
Bob Beck | a3add9e | 2023-08-25 16:40:58 +0000 | [diff] [blame] | 18 | FilePath(); |
| 19 | FilePath(const std::string &path); |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 20 | |
Bob Beck | a3add9e | 2023-08-25 16:40:58 +0000 | [diff] [blame] | 21 | const std::string &value() const; |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 22 | |
Bob Beck | a3add9e | 2023-08-25 16:40:58 +0000 | [diff] [blame] | 23 | FilePath AppendASCII(const std::string &ascii_path_element) const; |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 24 | |
| 25 | private: |
| 26 | std::string path_; |
| 27 | }; |
| 28 | |
Bob Beck | a1403cb | 2023-08-28 16:44:45 +0000 | [diff] [blame] | 29 | enum PathKey { |
Bob Beck | 7fb818f | 2023-10-25 20:13:06 +0000 | [diff] [blame] | 30 | BSSL_TEST_DATA_ROOT = 0, |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 31 | }; |
| 32 | |
Bob Beck | 85081c6 | 2023-08-28 21:25:30 +0000 | [diff] [blame] | 33 | class PathService { |
Bob Beck | bc97b7a | 2023-04-18 08:35:15 -0600 | [diff] [blame] | 34 | public: |
| 35 | static void Get(PathKey key, FilePath *out); |
| 36 | }; |
| 37 | |
| 38 | } // namespace fillins |
| 39 | |
| 40 | } // namespace bssl |
| 41 | |
| 42 | #endif // BSSL_FILLINS_PATH_SERVICE_H |