Marco Poletti | b5239c9 | 2022-05-11 09:46:05 -0700 | [diff] [blame] | 1 | // Part of the Crubit project, under the Apache License v2.0 with LLVM |
| 2 | // Exceptions. See /LICENSE for license information. |
| 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 | |
| 5 | #ifndef CRUBIT_MIGRATOR_RS_FROM_CC_RS_FROM_CC_LIB_H_ |
| 6 | #define CRUBIT_MIGRATOR_RS_FROM_CC_RS_FROM_CC_LIB_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "absl/container/flat_hash_map.h" |
| 11 | #include "absl/status/statusor.h" |
| 12 | #include "absl/strings/string_view.h" |
| 13 | #include "absl/types/span.h" |
| 14 | |
| 15 | namespace crubit_rs_from_cc { |
| 16 | |
| 17 | // Converts C++ source code into Rust. |
| 18 | // |
| 19 | // Parameters: |
| 20 | // * `cc_file_content`: a string with the C++ source code to convert. |
| 21 | // * `cc_file_name`: name of the C++ file we're converting. Can be omitted for |
| 22 | // tests. |
| 23 | // * `args`: additional command line arguments for Clang (if any) |
| 24 | // |
| 25 | absl::StatusOr<std::string> RsFromCc( |
| 26 | absl::string_view cc_file_content, |
| 27 | absl::string_view cc_file_name = "testing/file_name.cc", |
| 28 | absl::Span<const absl::string_view> args = {}); |
| 29 | |
| 30 | } // namespace crubit_rs_from_cc |
| 31 | |
| 32 | #endif // CRUBIT_MIGRATOR_RS_FROM_CC_RS_FROM_CC_LIB_H_ |