Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Utils.cpp
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#include "Stroika/Foundation/StroikaPreComp.h"
5
7
8#include "Utils.h"
9
10using namespace Stroika::Foundation;
11
12using namespace Characters;
13using namespace Database;
14
15// Comment this in to turn on aggressive noisy DbgTrace in this module
16//#define USE_NOISY_TRACE_IN_THIS_MODULE_ 1
17
18/*
19 ********************************************************************************
20 *********************** SQL::Utils::QuoteStringForDB *****************************
21 ********************************************************************************
22 */
23String SQL::Utils::QuoteStringForDB (const String& s)
24{
25 if (s.Contains ('\'')) {
27 for (Character c : s) {
28 if (c == '\'') {
29 sb << '\'';
30 }
31 sb << c;
32 }
33 return sb;
34 }
35 else {
36 return s;
37 }
38}
Similar to String, but intended to more efficiently construct a String. Mutable type (String is large...
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201
nonvirtual bool Contains(Character c, CompareOptions co=eWithCase) const
Definition String.inl:693