Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
sqlite
detail
normalize_statement.cc
Go to the documentation of this file.
1
#include "
cetlib/sqlite/detail/normalize_statement.h
"
2
3
#include <regex>
4
5
void
6
cet::sqlite::detail::normalize_statement
(
std::string
& to_replace)
7
{
8
// Remove spaces around commas
9
{
10
std::regex
const
r
{
"\\s*,\\s*"
};
11
to_replace = std::regex_replace(to_replace,
r
,
","
);
12
}
13
// Remove spaces around parentheses
14
{
15
std::regex
const
r
{R
"(\s*([\(\)])\s*)"};
16
to_replace = std::regex_replace(to_replace,
r
,
"$1"
);
17
}
18
// Replace multiple spaces with 1 space.
19
{
20
std::regex
const
r
{
"\\s+"
};
21
to_replace = std::regex_replace(to_replace,
r
,
" "
);
22
}
23
}
24
25
std::string
cet::sqlite::detail::normalized_statement
(
26
std::string
to_replace)
// Argument is a copy!
27
{
28
normalize_statement
(to_replace);
29
return
to_replace;
30
}
string
std::string string
Definition:
nybbler.cc:12
cet::sqlite::detail::normalize_statement
void normalize_statement(std::string &to_replace)
Definition:
normalize_statement.cc:6
cet::sqlite::detail::normalized_statement
std::string normalized_statement(std::string to_replace)
Definition:
normalize_statement.cc:25
normalize_statement.h
plot_model.r
r
Definition:
plot_model.py:57
Generated by
1.8.11