1 /*
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 
17 #pragma once
18 
19 #include <memory>
20 #include <string>
21 
22 #include "aidl_language.h"
23 #include "aidl_to_cpp.h"
24 #include "aidl_to_cpp_common.h"
25 #include "ast_cpp.h"
26 #include "options.h"
27 
28 namespace android {
29 namespace aidl {
30 namespace cpp {
31 
32 bool GenerateCpp(const string& output_file, const Options& options, const AidlTypenames& typenames,
33                  const AidlDefinedType& parsed_doc, const IoDelegate& io_delegate);
34 
35 namespace internals {
36 std::unique_ptr<Document> BuildClientSource(const AidlTypenames& typenames,
37                                             const AidlInterface& parsed_doc,
38                                             const Options& options);
39 std::unique_ptr<Document> BuildServerSource(const AidlTypenames& typenames,
40                                             const AidlInterface& parsed_doc,
41                                             const Options& options);
42 std::unique_ptr<Document> BuildInterfaceSource(const AidlTypenames& typenames,
43                                                const AidlInterface& parsed_doc,
44                                                const Options& options);
45 std::unique_ptr<Document> BuildClientHeader(const AidlTypenames& typenames,
46                                             const AidlInterface& parsed_doc,
47                                             const Options& options);
48 std::unique_ptr<Document> BuildServerHeader(const AidlTypenames& typenames,
49                                             const AidlInterface& parsed_doc,
50                                             const Options& options);
51 std::unique_ptr<Document> BuildInterfaceHeader(const AidlTypenames& typenames,
52                                                const AidlInterface& parsed_doc,
53                                                const Options& options);
54 std::unique_ptr<Document> BuildEnumHeader(const AidlTypenames& typenames,
55                                           const AidlEnumDeclaration& parsed_doc);
56 }
57 }  // namespace cpp
58 }  // namespace aidl
59 }  // namespace android
60