blob: 12d9f57bc21fc4daef12632efaccbf64ac9c5cfe [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
15int generate_java(const string& filename, const string& originalSrc,
Christopher Wiley214c9162015-09-24 00:26:08 +000016 interface_type* iface);
Adam Lesinskiffa16862014-01-23 18:17:42 -080017
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070018android::aidl::Class* generate_binder_interface_class(
Christopher Wiley214c9162015-09-24 00:26:08 +000019 const interface_type* iface);
Adam Lesinskiffa16862014-01-23 18:17:42 -080020
21string gather_comments(extra_text_type* extra);
22string append(const char* a, const char* b);
23
24class VariableFactory
25{
26public:
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070027 using Variable = android::aidl::Variable;
28 using Type = android::aidl::Type;
29
Adam Lesinskiffa16862014-01-23 18:17:42 -080030 VariableFactory(const string& base); // base must be short
Christopher Wiley8f6816e2015-09-22 17:03:47 -070031 Variable* Get(const Type* type);
Adam Lesinskiffa16862014-01-23 18:17:42 -080032 Variable* Get(int index);
33private:
34 vector<Variable*> m_vars;
35 string m_base;
36 int m_index;
37};
38
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070039} // namespace android
40} // namespace aidl
Adam Lesinskiffa16862014-01-23 18:17:42 -080041
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070042#endif // AIDL_GENERATE_JAVA_H_