]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_tag.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
8 #include <include/types.h>
14 using tag_map_t
= std::multimap
<std::string
, std::string
>;
19 uint32_t max_obj_tags
{10};
20 static constexpr uint32_t max_tag_key_size
{128};
21 static constexpr uint32_t max_tag_val_size
{256};
24 RGWObjTags() = default;
25 RGWObjTags(uint32_t max_obj_tags
):max_obj_tags(max_obj_tags
) {}
27 void encode(bufferlist
& bl
) const {
33 void decode(bufferlist::const_iterator
&bl
) {
34 DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl
);
39 void dump(Formatter
*f
) const;
40 void add_tag(const std::string
& key
, const std::string
& val
="");
41 void emplace_tag(std::string
&& key
, std::string
&& val
);
42 int check_and_add_tag(const std::string
& key
, const std::string
& val
="");
43 size_t count() const {return tag_map
.size();}
44 int set_from_string(const std::string
& input
);
45 void clear() { tag_map
.clear(); }
46 bool empty() const noexcept
{ return tag_map
.empty(); }
47 const tag_map_t
& get_tags() const {return tag_map
;}
48 tag_map_t
& get_tags() {return tag_map
;}
50 WRITE_CLASS_ENCODER(RGWObjTags
)
52 #endif /* RGW_TAG_H */