blob: 2f063234cde0b2226ca47fcd643016e63b954236 [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 Wileydb154a52015-09-28 16:32:25 -070015namespace java {
16
Christopher Wiley84c1eac2015-09-23 13:29:28 -070017class JavaTypeNamespace;
18
Adam Lesinskiffa16862014-01-23 18:17:42 -080019int generate_java(const string& filename, const string& originalSrc,
Casey Dahlin1ae2bc52015-10-07 18:49:10 -070020 AidlInterface* iface, java::JavaTypeNamespace* types);
Adam Lesinskiffa16862014-01-23 18:17:42 -080021
Christopher Wileydb154a52015-09-28 16:32:25 -070022android::aidl::java::Class* generate_binder_interface_class(
Casey Dahlin1ae2bc52015-10-07 18:49:10 -070023 const AidlInterface* iface, java::JavaTypeNamespace* types);
Christopher Wileydb154a52015-09-28 16:32:25 -070024
25} // namespace java
Adam Lesinskiffa16862014-01-23 18:17:42 -080026
Adam Lesinskiffa16862014-01-23 18:17:42 -080027string append(const char* a, const char* b);
28
29class VariableFactory
30{
31public:
Christopher Wileydb154a52015-09-28 16:32:25 -070032 using Variable = ::android::aidl::java::Variable;
33 using Type = ::android::aidl::java::Type;
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070034
Adam Lesinskiffa16862014-01-23 18:17:42 -080035 VariableFactory(const string& base); // base must be short
Christopher Wiley8f6816e2015-09-22 17:03:47 -070036 Variable* Get(const Type* type);
Adam Lesinskiffa16862014-01-23 18:17:42 -080037 Variable* Get(int index);
38private:
39 vector<Variable*> m_vars;
40 string m_base;
41 int m_index;
42};
43
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070044} // namespace android
45} // namespace aidl
Adam Lesinskiffa16862014-01-23 18:17:42 -080046
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070047#endif // AIDL_GENERATE_JAVA_H_