blob: b67a88c9852410c22f02171b6dcb625bdb1fe5c0 [file] [log] [blame]
Christopher Wiley89e35862015-08-30 10:57:07 -07001#ifndef AIDL_GENERATE_JAVA_H_
2#define AIDL_GENERATE_JAVA_H_
Adam Lesinskiffa16862014-01-23 18:17:42 -08003
Adam Lesinskiffa16862014-01-23 18:17:42 -08004#include <string>
5
Christopher Wiley038485e2015-09-12 11:14:14 -07006#include "aidl_language.h"
7#include "ast_java.h"
8
Christopher Wileyfdeb0f42015-09-11 15:38:22 -07009namespace android {
10namespace aidl {
11
Christopher Wiley9f4c7ae2015-08-24 14:07:32 -070012using std::string;
13using std::vector;
Adam Lesinskiffa16862014-01-23 18:17:42 -080014
Christopher Wiley84c1eac2015-09-23 13:29:28 -070015class JavaTypeNamespace;
16
Adam Lesinskiffa16862014-01-23 18:17:42 -080017int generate_java(const string& filename, const string& originalSrc,
Christopher Wiley84c1eac2015-09-23 13:29:28 -070018 interface_type* iface, JavaTypeNamespace* types);
Adam Lesinskiffa16862014-01-23 18:17:42 -080019
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070020android::aidl::Class* generate_binder_interface_class(
Christopher Wiley84c1eac2015-09-23 13:29:28 -070021 const interface_type* iface, JavaTypeNamespace* types);
Adam Lesinskiffa16862014-01-23 18:17:42 -080022
23string gather_comments(extra_text_type* extra);
24string append(const char* a, const char* b);
25
26class VariableFactory
27{
28public:
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070029 using Variable = android::aidl::Variable;
30 using Type = android::aidl::Type;
31
Adam Lesinskiffa16862014-01-23 18:17:42 -080032 VariableFactory(const string& base); // base must be short
Christopher Wiley8f6816e2015-09-22 17:03:47 -070033 Variable* Get(const Type* type);
Adam Lesinskiffa16862014-01-23 18:17:42 -080034 Variable* Get(int index);
35private:
36 vector<Variable*> m_vars;
37 string m_base;
38 int m_index;
39};
40
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070041} // namespace android
42} // namespace aidl
Adam Lesinskiffa16862014-01-23 18:17:42 -080043
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070044#endif // AIDL_GENERATE_JAVA_H_