generate C++ interface header, proxy and stub headers and sources.
diff --git a/Method.cpp b/Method.cpp
index b9eb885..b6281d1 100644
--- a/Method.cpp
+++ b/Method.cpp
@@ -16,10 +16,19 @@
out << mName;
}
+std::string TypedVar::name() const {
+ return mName;
+}
+
+const Type &TypedVar::type() const {
+ return *mType;
+}
+
+
Method::Method(
const char *name,
- Vector<TypedVar *> *args,
- Vector<TypedVar *> *results)
+ std::vector<TypedVar *> *args,
+ std::vector<TypedVar *> *results)
: mName(name),
mArgs(args),
mResults(results) {
@@ -33,7 +42,7 @@
out << ", ";
}
- mArgs->itemAt(i)->dump(out);
+ (*mArgs)[i]->dump(out);
}
out << ")";
@@ -46,7 +55,7 @@
out << ", ";
}
- mResults->itemAt(i)->dump(out);
+ (*mResults)[i]->dump(out);
}
out << ")";
@@ -55,5 +64,38 @@
out << ";";
}
+std::string Method::name() const {
+ return mName;
+}
+
+const std::vector<TypedVar *> &Method::args() const {
+ return *mArgs;
+}
+
+const std::vector<TypedVar *> &Method::results() const {
+ return *mResults;
+}
+
+// static
+std::string Method::GetSignature(const std::vector<TypedVar *> &args) {
+ bool first = true;
+ std::string out;
+ for (const auto &arg : args) {
+ if (!first) {
+ out += ", ";
+ }
+
+ std::string extra;
+ out += arg->type().getCppArgumentType(&extra);
+ out += " ";
+ out += arg->name();
+ out += extra;
+
+ first = false;
+ }
+
+ return out;
+}
+
} // namespace android