Realm C++ SDKバージョン v 2.2.0
-すべて クラス 関数 Variables Typedefs 列挙 ページ

app.hpp

1
2//
3// © 2022 Realm Inc.
4//
5// Apache ライセンス、バージョン 2.0(「ライセンス」)に基づいてライセンスされている
6// ライセンス に準拠している場合を除き、このファイルを使用することはできません。
7// ライセンスのコピーは次で取得できます:
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// 該当するルールによって要求されたり、書込み (write) で同意された場合を除き、ソフトウェア
12ライセンスに基づいて配布される // は "AS IS" CRUD で配布されるため、
13// 任意の種類の 保証 または 条件なし(式またはExpressのいずれか)。
14// 特定の言語を使用する権限については、「ライセンス」を参照してください
15ライセンスに基づく // の制限。
16//
18
19#ifndef CPPREALM_APP_HPP
20CPREALM_OP_HPP を定義します
21
22#include <cpprealm/bson.hpp>
23#include <cpprealm/db.hpp>
24
25#include <cpprealm/ internal/bridge/realm.hpp>
26#include <cpprealm/ internal/bridge/sync_error.hpp>
27#include <cpprealm/ internal/bridge/sync_manager.hpp>
28#include <cpprealm/ internal/bridge/sync_session.hpp>
29#include <cpprealm/ internal/bridge/uts.hpp>
30#include <cpprealm/network/HTTP.hpp>
31#include <cpprealm/network/websocket.hpp>
32
33#include <feature"<future>
34#include<utility>
35
36名前空間邦土 {
37
38 using proxy_config = sync_config::proxy_config;
39 同期_セッション = internal::bridge::sync_sessionを使用しています。
40
41 namespace app {
42 クラスApp
43 クラスユーザー
44 struct AppError
45 } // 名前空間アプリ
46 名前空間内部::bridge {
47 struct sync_error
48 }
49
50// マーク: ユーザー
51
52// サーバーからのエラー状態を表します。
53構造体 app_error {
54 app_error () = delete .
55 app_errorconst app_errorおよびその他)
56 app_error & 演算子=( const app_error &その他) }
57 app_errorapp_error &その他)
58 app_error & 演算子=( app_error &その他)
59 ~app_error ()。
60 app_error (realm::app::AppError=================================================== //NOLINT(google-explit-structor)
61
62 [[nodiscard]] std::string_viewmessage() const
63
64 [[nodiscard]] std::string_view link_to_server_logs() const }
65
66 [[nodiscard]]ブール値_json_error () の接続 、
67
68 [[nodiscard]]ブール値_service_error () が 含む 、
69
70 [[nodiscard]]ブール値は_ http_error () が 含む 、
71
72 [[nodiscard]]ブール値は_custom_error() const
73
74 [[nodiscard]]ブール値は_client_error() const
75private :
76#ifdef CPREALM_HAV_GENERTED_BRIDGE_TypeS
77 internal::bridge::storage::AppError m_error 1 :
78#else
79std::shared_ptr[realm::app::AppError><realm::app::AppError> m_error]
80#endif
81};
82
92構造体 user {
93 ユーザー()=デフォルト
94 userconst user &)=デフォルト)。
95 useruser &+)=デフォルト)。
96 ユーザーと演算子=( const userと)=デフォルトの 。
97 ユーザーと演算子=(ユーザーと+)=デフォルトの 。
98 explicit user (std::shared_ptr[app::User><app::User> user )]
99 bool is_logged_in() const;
100
104 列挙クラス 状態: uint8_t {
105 logged_out,
106 logged_in,
107が削除されました、
108 };
109
114 [[nodiscard]] std::string識別子() const
115
119[[ nodiscard]] 状態 ( ) const
120
127 [[nodiscard]] std::string access_token () const
128
135 [[nodiscard]] std::string refresh_token () const
136
137 構造体 internal::bridge::sync_manager sync_manager()const
138
139 [[nodiscard]] db_configFlexible_sync_configuration () const
140
148 void log_out(std::function<void(std::optional<app_error>)>&& callback) const;
149
150 [[nodiscard]] std::feature=feature=id=log_out() <void>const ========================================================================================= ========================================================================================
151
152
153 [[deprecated("Replaced by `get_custom_data()`. This method will be removed in a future release.")]]
154 [[nodiscard]] std::optional<std::string> custom_data() const;
155
160[[nodiscard]] std::optional[bsoncx::document><bsoncxx::document> get_custom_data () const ]
161
170 [[非推奨( "この関数は非推奨であり、BSON ベースの Call_function API." )] に置き換えられます
171 void Call_functionconst std::string+ name、 const std::string+ args_ejson、
172std::function=null(std::optional=std:string>、std::optional= <std::string>app_error<app_error> >)> コールバック) const
173
182 [[非推奨( "この関数は非推奨であり、BSON ベースの Call_function API." )] に置き換えられます
183[[ nodiscard ]] std::feature=std:: optional =std::string======================================================<std::string>
184 const std::string& args_ejson) const;
185
194 void Call_function const std::string+ name、 const std::vector+args_bson、<bsoncxx>
195std::function=null(std::optional= bsoncx <bsoncxx>>、std::optional=<app_error> app_error ========================================================
196
204[[ nodiscard ]] std ::feature=std::optional=<bsoncxx><bsoncxx> bsoncx =========================================================================
205
209 void refresh_custom_user_data (std::function=double(std::optional= app_error<app_error> >)> コールバック)
210
214[[nodiscard]] std::feature"opid"<void> refresh_custom_user_data () const
215
216std::shared_ptr[app::User><app::User> m_user]
217};
218
219ブール演算子==( const user と Lhs、 const user と Rhs)。
220ブール演算子!=( const user と Lhs、 const user と rhs )。
221
222namespace app {
223 struct AppCredentials
224 }
225
226クラス アプリ{
227public:
236 構造体 構成{
238 std::string app_id }
240std::optional{std::string><std::string> base_url }
242std::optional[std::string]><std::string> パス
243 [[非推奨( "ネットワーク オプションはカスタム ネットワーク実装経由で提供する必要があります。" )]]
244 std::optional=std::map=std::string, std::string> custom_HTTP_headers
246 std::optional=std::array=char、 64 > metadata_encryption_key
248 ブール enable_ cacheing = true
249 [[非推奨( "ネットワーク オプションはカスタム ネットワーク実装経由で提供する必要があります。" )]]
250std::optional=sync_config::proxy_config><sync_config::proxy_config> proxy_configuration
257std::shared_ptr[network::<networking::http_transport_client> http_transport_client> http_transport_client ]
261std::shared_ptr[network::sync_socket_provider><networking::sync_socket_provider> sync_socket_provider ]
262
263 };
264
265
266 アプリ構成および)。
267
268 構造体 認証情報{
269 静的 認証情報匿名()。
270 静的 認証情報api_key( const std::string( キー))
271 静的 Credentials Facebook( const std::string+ access_token )
272 静的 認証情報Apple( const std::string+ id_token)
273 静的 認証情報google_auth_code( const std::string+auth_code)
274 静的 credentials google_id_token(const std::string& id_token);
275 静的 認証情報カスタム( const std:string+ トークン)
276 静的 Credentials username_password( const std::string+ ユーザー名、 const std::string+ パスワード)
277 静的 認証情報関数( const std::string+ payload)
278 認証情報()
279 認証情報構成認証情報およびその他) 、
280 認証情報&演算子=(認証情報とその他) を使用します。
281 認証情報認証情報とその他)
282 認証情報& 演算子 =(認証情報とその他)
283 ~認証情報()。
284 private :
285 認証情報 (app:: AppCredentials &= 認証情報 )では、 以外の 、 、
286 演算子app::AppCredentials() const
287 友人 クラス アプリ
288
289#ifdef CPREALM_HAV_GENERTED_BRIDGE_TypeS
290 internal::bridge::storage::AppCredentials m_credentials[ 1 ]
291#else
292std::shared_ptr[app::AppCredentials><app::AppCredentials> m_credentials]
293#endif
294 };
295
296std::feature[vid]<void> register_user( const std::string+ ユーザー名、 const std::string+ パスワード)。
297std::kubernetes たとえば、<user> login( const 認証情報 認証情報 ):
299 [[nodiscard]] internal::bridge::sync_manager get_sync_manager() const
300[[nodiscard]] std::optional[user]><user> get_current_user() const }
301 無効のクリア_キャッシュ_アプリ()。
302<App><std::string>
303 std::string get_base_url() const
304
305#ifdef REALM_enable_EXPERIます
314[[nodiscard]] std:::kubernetes たとえば、<void> update_base_url(std::string base_url) const
315#endif
316
317 [[nodiscard]] std::string path_for_realm( const Realm::sync_config &) const
318private :
319std::shared_ptr[app::App><app::App> m_app]
320 アプリ (std::shared_ptr[app::App>+8)<app::App> : m_app(std::move(a)) { }
321};
322
323 }
324#endif /* CPREALM_OP_HPP */
定義: app.happ: 226
定義: app.happ: 236
ブール enable_ cacheing
指定された App ID に対してアプリとその構成をキャッシュします。 デフォルトではオンになっています。
定義: app.happ: 248
std::optional< std::string > base_url
リクエストするカスタム ベース URL。 設定されない場合、または nil に設定されている場合、アプリ サービスのデフォルトのベース URL...
定義: app.happ: 240
std::optional[ std::string] >< std::string > パス
Realm ファイルのカスタム ロケーション。
定義: app.happ: 242
std::optional[ std::array[ ] 文字、 64 > > metadata_encryption_key
メタデータ Realm のカスタム暗号化キー。
定義: app.happ: 246
std::shared_ptr[< networking::sync_socket_provider > networking::sync_socket_provider > sync_socket_provider
定義: app.happ: 261
std::shared_ptr[< networking::http_transport_client > networking :: http_transport_client > http_transport_client
定義: app.happ: 257
std::string app_id
Atlas Device Sync アプリケーションのアプリ ID。
定義: app.happ: 238
定義: app.happ: 268
定義: app.happ: 53
定義: sync_manager.happ: 33
定義: app.happ: 92
std::string refresh_token()const
定義: app.cp: 181
無効呼び出し_関数(const std::string &name、const std::string &args_ejson、std::function(std::optional[std::string]< std::string > >, std::optional[app_error]< app_error > >)const
定義: app.cp: 245
std::optional< bsoncxx::document > get_custom_data() const
定義: app.cp: 236
状態
定義: app.happ: 104
std::string access_token()const
定義: app.cp: 170
std::future< void > refresh_custom_user_data() const
定義: app.cp: 311
std::string identity()const
定義: app.cp: 151