X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Frgw%2Frgw_tag_s3.cc;fp=src%2Fceph%2Fsrc%2Frgw%2Frgw_tag_s3.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=1b7f717c96b98d52d27971c18a52db4d04df9106;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/rgw/rgw_tag_s3.cc b/src/ceph/src/rgw/rgw_tag_s3.cc deleted file mode 100644 index 1b7f717..0000000 --- a/src/ceph/src/rgw/rgw_tag_s3.cc +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include -#include - -#include "include/types.h" - -#include "rgw_tag_s3.h" - -bool RGWObjTagEntry_S3::xml_end(const char*){ - RGWObjTagKey_S3 *key_obj = static_cast(find_first("Key")); - RGWObjTagValue_S3 *val_obj = static_cast(find_first("Value")); - - if (!key_obj) - return false; - - string s = key_obj->get_data(); - if (s.empty()){ - return false; - } - - key = s; - if (val_obj) { - val = val_obj->get_data(); - } - - return true; -} - -bool RGWObjTagSet_S3::xml_end(const char*){ - XMLObjIter iter = find("Tag"); - RGWObjTagEntry_S3 *tagentry = static_cast(iter.get_next()); - while (tagentry) { - const std::string& key = tagentry->get_key(); - const std::string& val = tagentry->get_val(); - if (!add_tag(key,val)) - return false; - - tagentry = static_cast(iter.get_next()); - } - return true; -} - -int RGWObjTagSet_S3::rebuild(RGWObjTags& dest){ - int ret; - for (const auto &it: tag_map){ - ret = dest.check_and_add_tag(it.first, it.second); - if (ret < 0) - return ret; - } - return 0; -} - -bool RGWObjTagging_S3::xml_end(const char*){ - RGWObjTagSet_S3 *tagset = static_cast (find_first("TagSet")); - return tagset != nullptr; - -} - -void RGWObjTagSet_S3::dump_xml(Formatter *f){ - for (const auto& tag: tag_map){ - f->open_object_section("Tag"); - f->dump_string("Key", tag.first); - f->dump_string("Value", tag.second); - f->close_section(); - } -} - -XMLObj *RGWObjTagsXMLParser::alloc_obj(const char *el){ - XMLObj* obj = nullptr; - if(strcmp(el,"Tagging") == 0) { - obj = new RGWObjTagging_S3(); - } else if (strcmp(el,"TagSet") == 0) { - obj = new RGWObjTagSet_S3(); - } else if (strcmp(el,"Tag") == 0) { - obj = new RGWObjTagEntry_S3(); - } else if (strcmp(el,"Key") == 0) { - obj = new RGWObjTagKey_S3(); - } else if (strcmp(el,"Value") == 0) { - obj = new RGWObjTagValue_S3(); - } - - return obj; -}