The open source OpenXR runtime
1// Copyright 2020-2021, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3// Author: Rylie Pavlik <rylie.pavlik@collabora.com>
4
5#pragma once
6
7#include "ObjectWrapperBase.h"
8
9namespace wrap {
10namespace android::database {
11/*!
12 * Wrapper for android.database.Cursor objects.
13 */
14class Cursor : public ObjectWrapperBase {
15 public:
16 using ObjectWrapperBase::ObjectWrapperBase;
17 static constexpr const char *getTypeName() noexcept {
18 return "android/database/Cursor";
19 }
20
21 /*!
22 * Wrapper for the getCount method
23 *
24 * Java prototype:
25 * `public abstract int getCount();`
26 *
27 * JNI signature: ()I
28 *
29 */
30 int32_t getCount();
31
32 /*!
33 * Wrapper for the moveToFirst method
34 *
35 * Java prototype:
36 * `public abstract boolean moveToFirst();`
37 *
38 * JNI signature: ()Z
39 *
40 */
41 bool moveToFirst();
42
43 /*!
44 * Wrapper for the moveToNext method
45 *
46 * Java prototype:
47 * `public abstract boolean moveToNext();`
48 *
49 * JNI signature: ()Z
50 *
51 */
52 bool moveToNext();
53
54 /*!
55 * Wrapper for the getColumnIndex method
56 *
57 * Java prototype:
58 * `public abstract int getColumnIndex(java.lang.String);`
59 *
60 * JNI signature: (Ljava/lang/String;)I
61 *
62 */
63 int32_t getColumnIndex(std::string const &columnName);
64
65 /*!
66 * Wrapper for the getString method
67 *
68 * Java prototype:
69 * `public abstract java.lang.String getString(int);`
70 *
71 * JNI signature: (I)Ljava/lang/String;
72 *
73 */
74 std::string getString(int32_t column);
75
76 /*!
77 * Wrapper for the getInt method
78 *
79 * Java prototype:
80 * `public abstract int getInt(int);`
81 *
82 * JNI signature: (I)I
83 *
84 */
85 int32_t getInt(int32_t column);
86
87 /*!
88 * Wrapper for the close method
89 *
90 * Java prototype:
91 * `public abstract void close();`
92 *
93 * JNI signature: ()V
94 *
95 */
96 void close();
97
98 /*!
99 * Class metadata
100 */
101 struct Meta : public MetaBaseDroppable {
102 jni::method_t getCount;
103 jni::method_t moveToFirst;
104 jni::method_t moveToNext;
105 jni::method_t getColumnIndex;
106 jni::method_t getString;
107 jni::method_t getInt;
108 jni::method_t close;
109
110 /*!
111 * Singleton accessor
112 */
113 static Meta &data() {
114 static Meta instance{};
115 return instance;
116 }
117
118 private:
119 Meta();
120 };
121};
122
123} // namespace android::database
124} // namespace wrap
125#include "android.database.impl.h"