| 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" |
| Christopher Wiley | a30a45e | 2015-10-17 10:56:59 -0700 | [diff] [blame] | 8 | #include "io_delegate.h" |
| Christopher Wiley | 038485e | 2015-09-12 11:14:14 -0700 | [diff] [blame] | 9 | |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 10 | namespace android { |
| 11 | namespace aidl { |
| 12 | |
| Christopher Wiley | 9f4c7ae | 2015-08-24 14:07:32 -0700 | [diff] [blame] | 13 | using std::string; |
| 14 | using std::vector; |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 15 | |
| Christopher Wiley | db154a5 | 2015-09-28 16:32:25 -0700 | [diff] [blame] | 16 | namespace java { |
| 17 | |
| Christopher Wiley | 84c1eac | 2015-09-23 13:29:28 -0700 | [diff] [blame] | 18 | class JavaTypeNamespace; |
| 19 | |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 20 | int generate_java(const string& filename, const string& originalSrc, |
| Christopher Wiley | a30a45e | 2015-10-17 10:56:59 -0700 | [diff] [blame] | 21 | AidlInterface* iface, java::JavaTypeNamespace* types, |
| 22 | const IoDelegate& io_delegate); |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 23 | |
| Christopher Wiley | db154a5 | 2015-09-28 16:32:25 -0700 | [diff] [blame] | 24 | android::aidl::java::Class* generate_binder_interface_class( |
| Casey Dahlin | 1ae2bc5 | 2015-10-07 18:49:10 -0700 | [diff] [blame] | 25 | const AidlInterface* iface, java::JavaTypeNamespace* types); |
| Christopher Wiley | db154a5 | 2015-09-28 16:32:25 -0700 | [diff] [blame] | 26 | |
| 27 | } // namespace java |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 28 | |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 29 | string append(const char* a, const char* b); |
| 30 | |
| 31 | class VariableFactory |
| 32 | { |
| 33 | public: |
| Christopher Wiley | db154a5 | 2015-09-28 16:32:25 -0700 | [diff] [blame] | 34 | using Variable = ::android::aidl::java::Variable; |
| 35 | using Type = ::android::aidl::java::Type; |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 36 | |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 37 | VariableFactory(const string& base); // base must be short |
| Christopher Wiley | 8f6816e | 2015-09-22 17:03:47 -0700 | [diff] [blame] | 38 | Variable* Get(const Type* type); |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 39 | Variable* Get(int index); |
| 40 | private: |
| 41 | vector<Variable*> m_vars; |
| 42 | string m_base; |
| 43 | int m_index; |
| 44 | }; |
| 45 | |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 46 | } // namespace android |
| 47 | } // namespace aidl |
| Adam Lesinski | ffa1686 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 48 | |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 49 | #endif // AIDL_GENERATE_JAVA_H_ |