]>
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
7 #include <include/types.h>
13 using tag_map_t
= std::multimap
<std::string
, std::string
>;
18 uint32_t max_obj_tags
{10};
19 static constexpr uint32_t max_tag_key_size
{128};
20 static constexpr uint32_t max_tag_val_size
{256};
23 RGWObjTags() = default;
24 RGWObjTags(uint32_t max_obj_tags
):max_obj_tags(max_obj_tags
) {}
26 void encode(bufferlist
& bl
) const {
32 void decode(bufferlist::const_iterator
&bl
) {
33 DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl
);
38 void dump(Formatter
*f
) const;
39 void add_tag(const std::string
& key
, const std::string
& val
="");
40 void emplace_tag(std::string
&& key
, std::string
&& val
);
41 int check_and_add_tag(const std::string
& key
, const std::string
& val
="");
42 size_t count() const {return tag_map
.size();}
43 int set_from_string(const std::string
& input
);
44 void clear() { tag_map
.clear(); }
45 bool empty() const noexcept
{ return tag_map
.empty(); }
46 const tag_map_t
& get_tags() const {return tag_map
;}
47 tag_map_t
& get_tags() {return tag_map
;}
49 WRITE_CLASS_ENCODER(RGWObjTags
)