#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
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