5 #include "include/types.h"
7 #include "rgw_tag_s3.h"
9 bool RGWObjTagEntry_S3::xml_end(const char*){
10 RGWObjTagKey_S3 *key_obj = static_cast<RGWObjTagKey_S3 *>(find_first("Key"));
11 RGWObjTagValue_S3 *val_obj = static_cast<RGWObjTagValue_S3 *>(find_first("Value"));
16 string s = key_obj->get_data();
23 val = val_obj->get_data();
29 bool RGWObjTagSet_S3::xml_end(const char*){
30 XMLObjIter iter = find("Tag");
31 RGWObjTagEntry_S3 *tagentry = static_cast<RGWObjTagEntry_S3 *>(iter.get_next());
33 const std::string& key = tagentry->get_key();
34 const std::string& val = tagentry->get_val();
35 if (!add_tag(key,val))
38 tagentry = static_cast<RGWObjTagEntry_S3 *>(iter.get_next());
43 int RGWObjTagSet_S3::rebuild(RGWObjTags& dest){
45 for (const auto &it: tag_map){
46 ret = dest.check_and_add_tag(it.first, it.second);
53 bool RGWObjTagging_S3::xml_end(const char*){
54 RGWObjTagSet_S3 *tagset = static_cast<RGWObjTagSet_S3 *> (find_first("TagSet"));
55 return tagset != nullptr;
59 void RGWObjTagSet_S3::dump_xml(Formatter *f){
60 for (const auto& tag: tag_map){
61 f->open_object_section("Tag");
62 f->dump_string("Key", tag.first);
63 f->dump_string("Value", tag.second);
68 XMLObj *RGWObjTagsXMLParser::alloc_obj(const char *el){
69 XMLObj* obj = nullptr;
70 if(strcmp(el,"Tagging") == 0) {
71 obj = new RGWObjTagging_S3();
72 } else if (strcmp(el,"TagSet") == 0) {
73 obj = new RGWObjTagSet_S3();
74 } else if (strcmp(el,"Tag") == 0) {
75 obj = new RGWObjTagEntry_S3();
76 } else if (strcmp(el,"Key") == 0) {
77 obj = new RGWObjTagKey_S3();
78 } else if (strcmp(el,"Value") == 0) {
79 obj = new RGWObjTagValue_S3();