• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <limits>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "aidl_language.h"
25 #include "import_resolver.h"
26 #include "io_delegate.h"
27 #include "options.h"
28 #include "type_namespace.h"
29 
30 namespace android {
31 namespace aidl {
32 
33 enum class AidlError {
34   UNKOWN = std::numeric_limits<int32_t>::min(),
35   BAD_PRE_PROCESSED_FILE,
36   PARSE_ERROR,
37   FOUND_PARCELABLE,
38   BAD_PACKAGE,
39   BAD_IMPORT,
40   BAD_TYPE,
41   BAD_METHOD_ID,
42   GENERATION_ERROR,
43   BAD_INPUT,
44   NOT_STRUCTURED,
45 
46   OK = 0,
47 };
48 
49 int compile_aidl(const Options& options, const IoDelegate& io_delegate);
50 bool preprocess_aidl(const Options& options, const IoDelegate& io_delegate);
51 bool dump_api(const Options& options, const IoDelegate& io_delegate);
52 bool dump_mappings(const Options& options, const IoDelegate& io_delegate);
53 
54 const string kGetInterfaceVersion("getInterfaceVersion");
55 
56 namespace internals {
57 
58 AidlError load_and_validate_aidl(const std::string& input_file_name, const Options& options,
59                                  const IoDelegate& io_delegate, TypeNamespace* types,
60                                  vector<AidlDefinedType*>* defined_types,
61                                  vector<string>* imported_files);
62 
63 bool parse_preprocessed_file(const IoDelegate& io_delegate, const std::string& filename,
64                              TypeNamespace* types, AidlTypenames& typenames);
65 
66 } // namespace internals
67 
68 }  // namespace android
69 }  // namespace aidl
70