added sqlite query result and enhanced column generator and value extractor

This commit is contained in:
2023-11-14 20:21:51 +01:00
parent 4ed01a617d
commit d76ac60278
44 changed files with 1052 additions and 192 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
#ifndef QUERY_ACCESS_HPP
#define QUERY_ACCESS_HPP
#include "matador/utils/cascade_type.hpp"
#include <string>
namespace matador::utils {
enum class cascade_type;
template < class Type, template < class ... > class ContainerType >
class container;
+30
View File
@@ -15,5 +15,35 @@ namespace matador::utils {
*/
void replace_all(std::string &in, const std::string &from, const std::string &to);
const std::string& to_string(const std::string &str);
/**
* Joins a range of elements as string within a list
* with a given delimiter and writes it to the
* given stream
*
* @tparam R Type og the range (e.g. map, list, vector, etc)
* @param range The range with the elements to join
* @param delim The delimiter for the elements
* @return The ostream reference
*/
template < class R >
std::string join(R &range, const std::string &delim)
{
std::string result {};
if (range.size() < 2) {
for (const auto &i : range) {
result += to_string(i);
}
} else {
auto it = range.begin();
result += to_string(*it++);
for (;it != range.end(); ++it) {
result += delim + to_string(*it);
}
}
return result;
}
}
#endif //QUERY_STRING_HPP