aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/android/jni/jni_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/examples/android/jni/jni_utils.h')
-rw-r--r--tensorflow/examples/android/jni/jni_utils.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/tensorflow/examples/android/jni/jni_utils.h b/tensorflow/examples/android/jni/jni_utils.h
new file mode 100644
index 0000000000..9bd8d2c21f
--- /dev/null
+++ b/tensorflow/examples/android/jni/jni_utils.h
@@ -0,0 +1,30 @@
+#ifndef ORG_TENSORFLOW_JNI_JNI_UTILS_H_ // NOLINT
+#define ORG_TENSORFLOW_JNI_JNI_UTILS_H_ // NOLINT
+
+#include <jni.h>
+#include <string>
+#include <vector>
+
+#include "tensorflow/core/platform/port.h"
+
+namespace google {
+namespace protobuf {
+class MessageLite;
+} // google
+} // protobuf
+
+class AAssetManager;
+
+bool PortableReadFileToProto(const std::string& file_name,
+ ::google::protobuf::MessageLite* proto);
+
+void ReadFileToProto(AAssetManager* const asset_manager,
+ const char* const filename, google::protobuf::MessageLite* message);
+
+void ReadFileToString(AAssetManager* const asset_manager,
+ const char* const filename, std::string* str);
+
+void ReadFileToVector(AAssetManager* const asset_manager,
+ const char* const filename, std::vector<std::string>* str_vector);
+
+#endif // ORG_TENSORFLOW_JNI_JNI_UTILS_H_