This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
forked from ceph/ceph
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rgw/sfs: Convert SQLiteList::versions to sqlite_modern_cpp
Convert versions listing to sqlite_modern_cpp and add all necessary type bindings (ObjectState, VersionType, ceph::real_time) Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
- Loading branch information
Marcel Lauhoff
committed
Oct 25, 2023
1 parent
99e0a16
commit 8d384d3
Showing
7 changed files
with
187 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t | ||
// vim: ts=8 sw=2 smarttab ft=cpp | ||
/* | ||
* Ceph - scalable distributed file system | ||
* SFS SAL implementation | ||
* | ||
* Copyright (C) 2023 SUSE LLC | ||
* | ||
* This is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License version 2.1, as published by the Free Software | ||
* Foundation. See file COPYING. | ||
*/ | ||
|
||
#include <string> | ||
|
||
namespace rgw::sal::sfs::sqlite { | ||
|
||
std::string prefix_to_escaped_like(const std::string& prefix, char escape) { | ||
std::string like_expr; | ||
like_expr.reserve(prefix.length() + 10); | ||
for (const char c : prefix) { | ||
switch (c) { | ||
case '%': | ||
[[fallthrough]]; | ||
case '_': | ||
like_expr.push_back(escape); | ||
[[fallthrough]]; | ||
default: | ||
like_expr.push_back(c); | ||
} | ||
} | ||
like_expr.push_back('%'); | ||
return like_expr; | ||
} | ||
|
||
} // namespace rgw::sal::sfs::sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters