forked from SOCI/soci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to connection string handling: don't duplicate parsing code in Firebird, Oracle, PostgreSQL and SQLite backends. Also allow using connection_parameters::set_option() to set some option instead of having to specify it in the connection string itself. See SOCI#1176.
- Loading branch information
Showing
19 changed files
with
642 additions
and
514 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// Copyright (C) 2024 Vadim Zeitlin. | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#ifndef SOCI_PRIVATE_SOCI_CASE_H_INCLUDED | ||
#define SOCI_PRIVATE_SOCI_CASE_H_INCLUDED | ||
|
||
#include <cctype> | ||
#include <string> | ||
|
||
namespace soci | ||
{ | ||
|
||
namespace details | ||
{ | ||
|
||
// Simplistic conversions of strings to upper/lower case. | ||
// | ||
// This doesn't work correctly for arbitrary Unicode strings for well-known | ||
// reasons (such conversions can't be done correctly on char by char basis), | ||
// but they do work for ASCII strings that we deal with and for anything else | ||
// we'd need ICU -- which we could start using later, if necessary, by just | ||
// replacing these functions with the versions using ICU functions instead. | ||
|
||
inline std::string string_toupper(std::string const& s) | ||
{ | ||
std::string res; | ||
res.reserve(s.size()); | ||
|
||
for (char c : s) | ||
{ | ||
res += static_cast<char>(std::toupper(static_cast<unsigned char>(c))); | ||
} | ||
|
||
return res; | ||
} | ||
|
||
inline std::string string_tolower(std::string const& s) | ||
{ | ||
std::string res; | ||
res.reserve(s.size()); | ||
|
||
for (char c : s) | ||
{ | ||
res += static_cast<char>(std::tolower(static_cast<unsigned char>(c))); | ||
} | ||
|
||
return res; | ||
} | ||
|
||
} // namespace details | ||
|
||
} // namespace soci | ||
|
||
#endif // SOCI_PRIVATE_SOCI_CASE_H_INCLUDED |
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
Oops, something went wrong.