]>
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
8 #include <include/types.h>
9 #include <boost/container/flat_map.hpp>
11 #include "rgw_common.h"
16 using tag_map_t
= boost::container::flat_map
<std::string
, std::string
>;
22 void encode(bufferlist
& bl
) const {
28 void decode(bufferlist::const_iterator
&bl
) {
29 DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl
);
34 void dump(Formatter
*f
) const;
35 bool add_tag(const std::string
& key
, const std::string
& val
="");
36 bool emplace_tag(std::string
&& key
, std::string
&& val
);
37 int check_and_add_tag(const std::string
& key
, const std::string
& val
="");
38 size_t count() const {return tag_map
.size();}
39 int set_from_string(const std::string
& input
);
40 void clear() { tag_map
.clear(); }
41 bool empty() const noexcept
{ return tag_map
.empty(); }
42 const tag_map_t
& get_tags() const {return tag_map
;}
44 WRITE_CLASS_ENCODER(RGWObjTags
)
46 #endif /* RGW_TAG_H */