3#include "../domain/document_core.hpp"
14 eosio::check(registry_id == expected_registry_id,
"Передан неверный шаблон документа");
32 docs.push_back({name, doc});
43 for (
const auto& nd : docs) {
44 if (nd.name == name) {
45 found_doc = nd.document;
58 inline bool has_document(
const std::vector<named_document>& docs,
const name& name) {
59 for (
const auto& nd : docs) {
60 if (nd.name == name) {
Definition: document.hpp:6
bool has_document(const std::vector< named_document > &docs, const name &name)
Проверить наличие документа
Definition: document.hpp:58
void add_document(std::vector< named_document > &docs, const name &name, const document2 &doc)
Добавить документ с проверкой длины имени
Definition: document.hpp:31
bool is_document_empty(const document2 &document)
Проверить, является ли документ пустым по хэшу
Definition: document.hpp:72
void validate_registry_id(document2 document, uint64_t expected_registry_id)
Проверяет, что переданный документ соответствует ожидаемому шаблону
Definition: document.hpp:12
bool find_document(const std::vector< named_document > &docs, const name &name, document2 &found_doc)
Найти документ по имени
Definition: document.hpp:42
Структура именованного документа
Definition: document.hpp:20
name name
Definition: document.hpp:21
document2 document
Definition: document.hpp:22
Definition: document_core.hpp:27
Definition: document_core.hpp:10
checksum256 hash
Definition: document_core.hpp:11
std::string meta
Definition: document_core.hpp:14
uint64_t extract_registry_id_from_meta(const std::string &meta_json)
Definition: utils.hpp:75