mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
[css2xpath] pass by reference
This commit is contained in:
parent
e3849e567f
commit
983d3f990d
@ -6,7 +6,7 @@
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
implode(const char *const delim, std::vector<std::string> x)
|
implode(const char *const delim, std::vector<std::string> & x)
|
||||||
{
|
{
|
||||||
switch (x.size())
|
switch (x.size())
|
||||||
{
|
{
|
||||||
@ -38,7 +38,7 @@ explode(char delim, std::string const & s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
preg_replace(std::string pattern, const char *replacement, std::string subject)
|
preg_replace(std::string & pattern, const char *replacement, std::string & subject)
|
||||||
{
|
{
|
||||||
return std::regex_replace(subject, std::regex(pattern), replacement);
|
return std::regex_replace(subject, std::regex(pattern), replacement);
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ preg_replace(std::string pattern, const char *replacement, std::string subject)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
std::vector<std::string> x;
|
std::vector<std::string> x;
|
||||||
|
|
||||||
for (int i = 2; i < argc; i++) {
|
for (int i = 2; i < argc; i++) {
|
||||||
@ -57,7 +57,7 @@ main(int argc, char **argv)
|
|||||||
std::string res = implode(argv[1], x);
|
std::string res = implode(argv[1], x);
|
||||||
std::cout << res << "\n";
|
std::cout << res << "\n";
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 1
|
||||||
auto v = explode(' ', "hello world foo bar");
|
auto v = explode(' ', "hello world foo bar");
|
||||||
|
|
||||||
for (auto e : v)
|
for (auto e : v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user