blob: 3b7d2b948d6e61db9e1a962977df0bdfb8149b60 [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"
27
28namespace android {
29namespace aidl {
Christopher Wileyf944e792015-09-29 10:00:46 -070030namespace cpp {
Christopher Wileyeb1acc12015-09-16 11:25:13 -070031
Jeongik Cha1a7ab642019-07-29 17:31:02 +090032bool GenerateCpp(const string& output_file, const Options& options, const AidlTypenames& typenames,
Steven Moreland5557f1c2018-07-02 13:50:23 -070033 const AidlDefinedType& parsed_doc, const IoDelegate& io_delegate);
Christopher Wileyeb1acc12015-09-16 11:25:13 -070034
Christopher Wileyad339272015-10-05 19:11:58 -070035namespace internals {
Jeongik Cha1a7ab642019-07-29 17:31:02 +090036std::unique_ptr<Document> BuildClientSource(const AidlTypenames& typenames,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090037 const AidlInterface& parsed_doc,
38 const Options& options);
Jeongik Cha1a7ab642019-07-29 17:31:02 +090039std::unique_ptr<Document> BuildServerSource(const AidlTypenames& typenames,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090040 const AidlInterface& parsed_doc,
41 const Options& options);
Jeongik Cha1a7ab642019-07-29 17:31:02 +090042std::unique_ptr<Document> BuildInterfaceSource(const AidlTypenames& typenames,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090043 const AidlInterface& parsed_doc,
44 const Options& options);
Jeongik Cha1a7ab642019-07-29 17:31:02 +090045std::unique_ptr<Document> BuildClientHeader(const AidlTypenames& typenames,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090046 const AidlInterface& parsed_doc,
47 const Options& options);
Jeongik Cha1a7ab642019-07-29 17:31:02 +090048std::unique_ptr<Document> BuildServerHeader(const AidlTypenames& typenames,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090049 const AidlInterface& parsed_doc,
50 const Options& options);
Jeongik Cha1a7ab642019-07-29 17:31:02 +090051std::unique_ptr<Document> BuildInterfaceHeader(const AidlTypenames& typenames,
Jiyong Parkfbbfa932018-07-30 21:44:10 +090052 const AidlInterface& parsed_doc,
53 const Options& options);
Daniel Norman85aed542019-08-21 12:01:14 -070054std::unique_ptr<Document> BuildEnumHeader(const AidlTypenames& typenames,
55 const AidlEnumDeclaration& parsed_doc);
Christopher Wileyad339272015-10-05 19:11:58 -070056}
Christopher Wileyf944e792015-09-29 10:00:46 -070057} // namespace cpp
Christopher Wileyeb1acc12015-09-16 11:25:13 -070058} // namespace aidl
Christopher Wileyf944e792015-09-29 10:00:46 -070059} // namespace android