Lines Matching defs:ctxt
41 auto ctxt = std::make_shared<ContextBase>();
42 ctxt->GetCbInfoSync(env, info);
43 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
46 ASSERT_ERR(ctxt->env, file != nullptr, Status::E_ERROR, "no memory for file!");
48 ASSERT_CALL(env, napi_wrap(env, ctxt->self, file, Destructor, nullptr, nullptr), file);
49 return ctxt->self;
70 FileNapi *FileNapi::GetFile(napi_env env, napi_callback_info info, std::shared_ptr<ContextBase> ctxt)
73 ctxt->GetCbInfoSync(env, info);
74 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
75 return static_cast<FileNapi *>(ctxt->native);
81 auto ctxt = std::make_shared<ContextBase>();
82 auto file = GetFile(env, info, ctxt);
84 ctxt->env, (file != nullptr && file->value_ != nullptr), Status::E_ERROR, "invalid object!");
85 ctxt->status = NapiDataUtils::SetValue(env, file->value_->GetDetails(), ctxt->output);
86 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, "set details failed!");
87 return ctxt->output;
93 auto ctxt = std::make_shared<ContextBase>();
95 auto input = [env, ctxt, &details](size_t argc, napi_value *argv) {
96 ASSERT_BUSINESS_ERR(ctxt, argc >= 1,
98 ctxt->status = NapiDataUtils::GetValue(env, argv[0], details);
99 ASSERT_BUSINESS_ERR(ctxt, ctxt->status == napi_ok,
102 ctxt->GetCbInfoSync(env, info, input);
103 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
104 auto file = static_cast<FileNapi *>(ctxt->native);
106 ctxt->env, (file != nullptr && file->value_ != nullptr), Status::E_ERROR, "invalid object!");
114 auto ctxt = std::make_shared<ContextBase>();
115 auto file = GetFile(env, info, ctxt);
117 ctxt->env, (file != nullptr && file->value_ != nullptr), Status::E_ERROR, "invalid object!");
118 ctxt->status = NapiDataUtils::SetValue(env, file->value_->GetUri(), ctxt->output);
119 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, "set uri failed!");
120 return ctxt->output;
126 auto ctxt = std::make_shared<ContextBase>();
128 auto input = [env, ctxt, &uri](size_t argc, napi_value *argv) {
129 ASSERT_BUSINESS_ERR(ctxt, argc >= 1,
131 ctxt->status = NapiDataUtils::GetValue(env, argv[0], uri);
132 ASSERT_BUSINESS_ERR(ctxt, ctxt->status == napi_ok,
135 ctxt->GetCbInfoSync(env, info, input);
136 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
137 auto file = static_cast<FileNapi *>(ctxt->native);
139 ctxt->env, (file != nullptr && file->value_ != nullptr), Status::E_ERROR, "invalid object!");