]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/services/svc_tier_rados.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
4 #include "svc_tier_rados.h"
6 const std::string MP_META_SUFFIX
= ".meta";
8 bool MultipartMetaFilter::filter(const string
& name
, string
& key
) {
9 // the length of the suffix so we can skip past it
10 static const size_t MP_META_SUFFIX_LEN
= MP_META_SUFFIX
.length();
12 size_t len
= name
.size();
14 // make sure there's room for suffix plus at least one more
16 if (len
<= MP_META_SUFFIX_LEN
)
19 size_t pos
= name
.find(MP_META_SUFFIX
, len
- MP_META_SUFFIX_LEN
);
20 if (pos
== string::npos
)
23 pos
= name
.rfind('.', pos
- 1);
24 if (pos
== string::npos
)
27 key
= name
.substr(0, pos
);