| Christopher Wiley | 89e3586 | 2015-08-30 10:57:07 -0700 | [diff] [blame] | 1 | #ifndef AIDL_GENERATE_JAVA_H_ |
| 2 | #define AIDL_GENERATE_JAVA_H_ |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 3 | |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 4 | #include <string> |
| 5 | |
| Christopher Wiley | 038485e | 2015-09-12 11:14:14 -0700 | [diff] [blame] | 6 | #include "aidl_language.h" |
| 7 | #include "ast_java.h" |
| 8 | |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 9 | namespace android { |
| 10 | namespace aidl { |
| 11 | |
| Christopher Wiley | 9f4c7ae | 2015-08-24 14:07:32 -0700 | [diff] [blame] | 12 | using std::string; |
| 13 | using std::vector; |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 14 | |
| 15 | int generate_java(const string& filename, const string& originalSrc, |
| Christopher Wiley | 214c916 | 2015-09-24 00:26:08 +0000 | [diff] [blame] | 16 | interface_type* iface); |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 17 | |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 18 | android::aidl::Class* generate_binder_interface_class( |
| Christopher Wiley | 214c916 | 2015-09-24 00:26:08 +0000 | [diff] [blame] | 19 | const interface_type* iface); |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 20 | |
| 21 | string gather_comments(extra_text_type* extra); |
| 22 | string append(const char* a, const char* b); |
| 23 | |
| 24 | class VariableFactory |
| 25 | { |
| 26 | public: |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 27 | using Variable = android::aidl::Variable; |
| 28 | using Type = android::aidl::Type; |
| 29 | |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 30 | VariableFactory(const string& base); // base must be short |
| Christopher Wiley | 8f6816e | 2015-09-22 17:03:47 -0700 | [diff] [blame] | 31 | Variable* Get(const Type* type); |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 32 | Variable* Get(int index); |
| 33 | private: |
| 34 | vector<Variable*> m_vars; |
| 35 | string m_base; |
| 36 | int m_index; |
| 37 | }; |
| 38 | |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 39 | } // namespace android |
| 40 | } // namespace aidl |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 41 | |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 42 | #endif // AIDL_GENERATE_JAVA_H_ |