blob: 9b34b96bd8314ed3b40e997e8cb2c01f70fd3211 [file] [log] [blame]
Christopher Wileyeb1acc12015-09-16 11:25:13 -07001/*
2 * Copyright (C) 2015, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Steven Moreland9fccf582018-08-27 20:36:27 -070017#pragma once
Christopher Wileyeb1acc12015-09-16 11:25:13 -070018
Christopher Wiley3a9911c2016-01-19 12:59:09 -080019#include <memory>
20#include <string>
21
Christopher Wileyeb1acc12015-09-16 11:25:13 -070022#include "aidl_language.h"
Steven Moreland860b1942018-08-16 14:59:28 -070023#include "aidl_to_cpp.h"
Steven Morelandb0057e72018-08-27 01:44:11 -070024#include "aidl_to_cpp_common.h"
Christopher Wileyad339272015-10-05 19:11:58 -070025#include "ast_cpp.h"
Christopher Wileyeb1acc12015-09-16 11:25:13 -070026#include "options.h"
Christopher Wileye3550c62015-09-29 13:26:10 -070027#include "type_cpp.h"
Christopher Wileyeb1acc12015-09-16 11:25:13 -070028
29namespace android {
30namespace aidl {
Christopher Wileyf944e792015-09-29 10:00:46 -070031namespace cpp {
Christopher Wileyeb1acc12015-09-16 11:25:13 -070032
Jiyong Park74595c12018-07-23 15:22:50 +090033bool GenerateCpp(const string& output_file, const Options& options, const cpp::TypeNamespace& types,
Steven Moreland5557f1c2018-07-02 13:50:23 -070034 const AidlDefinedType& parsed_doc, const IoDelegate& io_delegate);
Christopher Wileyeb1acc12015-09-16 11:25:13 -070035
Christopher Wileyad339272015-10-05 19:11:58 -070036namespace internals {
37std::unique_ptr<Document> BuildClientSource(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090038 const AidlInterface& parsed_doc,
39 const Options& options);
Christopher Wileyad339272015-10-05 19:11:58 -070040std::unique_ptr<Document> BuildServerSource(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090041 const AidlInterface& parsed_doc,
42 const Options& options);
Christopher Wileyad339272015-10-05 19:11:58 -070043std::unique_ptr<Document> BuildInterfaceSource(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090044 const AidlInterface& parsed_doc,
45 const Options& options);
Christopher Wileyad339272015-10-05 19:11:58 -070046std::unique_ptr<Document> BuildClientHeader(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090047 const AidlInterface& parsed_doc,
48 const Options& options);
Christopher Wileyfd51d602015-10-14 13:04:48 -070049std::unique_ptr<Document> BuildServerHeader(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090050 const AidlInterface& parsed_doc,
51 const Options& options);
Christopher Wileyad339272015-10-05 19:11:58 -070052std::unique_ptr<Document> BuildInterfaceHeader(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090053 const AidlInterface& parsed_doc,
54 const Options& options);
Steven Moreland5557f1c2018-07-02 13:50:23 -070055
56std::unique_ptr<Document> BuildParcelHeader(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090057 const AidlStructuredParcelable& parsed_doc,
58 const Options& options);
Steven Moreland5557f1c2018-07-02 13:50:23 -070059std::unique_ptr<Document> BuildParcelSource(const TypeNamespace& types,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090060 const AidlStructuredParcelable& parsed_doc,
61 const Options& options);
Christopher Wileyad339272015-10-05 19:11:58 -070062}
Christopher Wileyf944e792015-09-29 10:00:46 -070063} // namespace cpp
Christopher Wileyeb1acc12015-09-16 11:25:13 -070064} // namespace aidl
Christopher Wileyf944e792015-09-29 10:00:46 -070065} // namespace android