]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_crypt.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rgw / rgw_crypt.h
index 29726a4a4f35d00ec14194c222d53a27ce84ab13..f397941632e0b845804a4845ec4f06e6b12add14 100644 (file)
@@ -8,11 +8,12 @@
 #ifndef CEPH_RGW_CRYPT_H
 #define CEPH_RGW_CRYPT_H
 
+#include <string_view>
+
 #include <rgw/rgw_op.h>
 #include <rgw/rgw_rest.h>
 #include <rgw/rgw_rest_s3.h>
 #include "rgw_putobj.h"
-#include <boost/utility/string_view.hpp>
 
 /**
  * \brief Interface for block encryption methods
@@ -149,4 +150,23 @@ int rgw_s3_prepare_decrypt(struct req_state* s,
                            std::map<std::string,
                                     std::string>& crypt_http_responses);
 
+static inline void set_attr(map<string, bufferlist>& attrs,
+                            const char* key,
+                            std::string_view value)
+{
+  bufferlist bl;
+  bl.append(value.data(), value.size());
+  attrs[key] = std::move(bl);
+}
+
+static inline std::string get_str_attribute(map<string, bufferlist>& attrs,
+                                            const char *name)
+{
+  auto iter = attrs.find(name);
+  if (iter == attrs.end()) {
+    return {};
+  }
+  return iter->second.to_str();
+}
+
 #endif