MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / process_array

Method process_array

runners/helpers/ValidateRequest.cpp:722–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720
721 template <typename F>
722 td::Status process_array(bool is_required, F &&run) {
723 if (!back().exists()) {
724 if (is_required) {
725 return td::Status::Error(ton::ErrorCode::protoviolation, PSTRING() << path() << " must exist");
726 }
727 return td::Status::OK();
728 }
729 return back().iterate_array([&](std::unique_ptr<CtxLevel> obj) {
730 levels.push_back(std::move(obj));
731 TRY_STATUS(run(*this));
732 TRY_STATUS(check_unprocessed_fields());
733 levels.pop_back();
734 return td::Status::OK();
735 });
736 }
737
738 bool is_string() {
739 return back().is_string();

Callers 6

process_string_or_arrayFunction · 0.80
process_string_or_objectFunction · 0.80
process_chat_completionsFunction · 0.80
process_completionsFunction · 0.80

Calls 3

runFunction · 0.85
existsMethod · 0.80
iterate_arrayMethod · 0.80

Tested by

no test coverage detected