diff options
author | Mike Lockwood <lockwood@google.com> | 2013-08-28 09:44:17 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@google.com> | 2013-08-28 09:44:17 -0700 |
commit | 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e (patch) | |
tree | 1391656f9ad624aa99d4c7d2880d38121801a424 /tools/aidl/generate_java.cpp | |
parent | 647b6f5ed276bf93d95e5801e5e8af2802ef5fbb (diff) | |
download | frameworks_base-9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.zip frameworks_base-9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.tar.gz frameworks_base-9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.tar.bz2 |
Move frameworks/base/tools/ to frameworks/tools/
Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
Diffstat (limited to 'tools/aidl/generate_java.cpp')
-rw-r--r-- | tools/aidl/generate_java.cpp | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/tools/aidl/generate_java.cpp b/tools/aidl/generate_java.cpp deleted file mode 100644 index 9e57407..0000000 --- a/tools/aidl/generate_java.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "generate_java.h" -#include "Type.h" -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -// ================================================= -VariableFactory::VariableFactory(const string& base) - :m_base(base), - m_index(0) -{ -} - -Variable* -VariableFactory::Get(Type* type) -{ - char name[100]; - sprintf(name, "%s%d", m_base.c_str(), m_index); - m_index++; - Variable* v = new Variable(type, name); - m_vars.push_back(v); - return v; -} - -Variable* -VariableFactory::Get(int index) -{ - return m_vars[index]; -} - -// ================================================= -string -gather_comments(extra_text_type* extra) -{ - string s; - while (extra) { - if (extra->which == SHORT_COMMENT) { - s += extra->data; - } - else if (extra->which == LONG_COMMENT) { - s += "/*"; - s += extra->data; - s += "*/"; - } - extra = extra->next; - } - return s; -} - -string -append(const char* a, const char* b) -{ - string s = a; - s += b; - return s; -} - -// ================================================= -int -generate_java(const string& filename, const string& originalSrc, - interface_type* iface) -{ - Class* cl; - - if (iface->document_item.item_type == INTERFACE_TYPE_BINDER) { - cl = generate_binder_interface_class(iface); - } - else if (iface->document_item.item_type == INTERFACE_TYPE_RPC) { - cl = generate_rpc_interface_class(iface); - } - - Document* document = new Document; - document->comment = ""; - if (iface->package) document->package = iface->package; - document->originalSrc = originalSrc; - document->classes.push_back(cl); - -// printf("outputting... filename=%s\n", filename.c_str()); - FILE* to; - if (filename == "-") { - to = stdout; - } else { - /* open file in binary mode to ensure that the tool produces the - * same output on all platforms !! - */ - to = fopen(filename.c_str(), "wb"); - if (to == NULL) { - fprintf(stderr, "unable to open %s for write\n", filename.c_str()); - return 1; - } - } - - document->Write(to); - - fclose(to); - return 0; -} - |