-
Notifications
You must be signed in to change notification settings - Fork 1
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 <[email protected]>
- Loading branch information
Marcel Lauhoff
committed
Oct 25, 2023
1 parent
84cef96
commit a882b4e
Showing
7 changed files
with
188 additions
and
75 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,35 @@ | ||
// -*- 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 '%': | ||
case '_': | ||
like_expr.push_back(escape); | ||
default: | ||
like_expr.push_back(c); | ||
} | ||
} | ||
like_expr.push_back('%'); | ||
return like_expr; | ||
} | ||
|
||
} |
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