#ifndef MEDIAPIPE_FRAMEWORK_TOOL_OPTIONS_FIELD_UTIL_H_
#define MEDIAPIPE_FRAMEWORK_TOOL_OPTIONS_FIELD_UTIL_H_
#include <string>
#include <vector>
#include "mediapipe/framework/calculator.pb.h"
#include "mediapipe/framework/packet.h"
#include "mediapipe/framework/packet_type.h"
#include "mediapipe/framework/port/advanced_proto_inc.h"
#include "mediapipe/framework/port/proto_ns.h"
#include "mediapipe/framework/tool/field_data.pb.h"
#include "mediapipe/framework/tool/options_registry.h"
namespace mediapipe {
namespace tool {
namespace options_field_util {
struct FieldPathEntry { … };
using FieldPath = std::vector<FieldPathEntry>;
absl::Status SetField(const FieldPath& field_path, const FieldData& value,
FieldData* message_data);
absl::StatusOr<FieldData> GetField(const FieldData& message_data,
const FieldPath& field_path);
absl::StatusOr<std::vector<FieldData>> GetFieldValues(
const FieldData& message_data, const FieldPath& field_path);
absl::Status SetFieldValues(FieldData& message_data,
const FieldPath& field_path,
const std::vector<FieldData>& values);
absl::Status MergeFieldValues(FieldData& message_data,
const FieldPath& field_path,
const std::vector<FieldData>& values);
absl::StatusOr<Packet> ReadMessage(const std::string& value,
const std::string& type_name);
absl::StatusOr<FieldData> MergeMessages(const FieldData& base,
const FieldData& over);
absl::StatusOr<FieldData> GetNodeOptions(const FieldData& message_data,
const std::string& extension_type);
absl::StatusOr<FieldData> GetGraphOptions(const FieldData& message_data,
const std::string& extension_type);
void SetOptionsMessage(const FieldData& node_options,
CalculatorGraphConfig::Node* node);
FieldData AsFieldData(const proto_ns::MessageLite& message);
absl::StatusOr<Packet> AsPacket(const FieldData& data);
absl::StatusOr<FieldData> AsFieldData(Packet packet);
std::string TypeUrl(absl::string_view type_name);
std::string ParseTypeUrl(absl::string_view type_url);
}
}
}
#endif