#pragma once namespace google { namespace protobuf { class Descriptor; class Message; } } namespace a8 { namespace mysql { class Query; } } bool ReadCsvMetaFile(const std::string& filename, google::protobuf::Message* prototype, std::function push_back_func); template bool ReadCsvMetaFile(const std::string& filename, std::list& meta_list) { T dummy; return ReadCsvMetaFile(filename, &dummy, [&meta_list] (google::protobuf::Message* msg) { T t; t.CopyFrom(*msg); meta_list.emplace_back(t); }); } template static void RepeatedFieldToVector(const T1& t1, T2& t2) { t2.clear(); for (auto& val : t1) { t2.push_back(val); } } template static void RepeatedFieldToSet(const T1& t1, T2& t2) { t2.clear(); for (auto& val : t1) { t2.insert(val); } } template static void VectorToRepeatedField(const T1& t1, T2& t2) { t2.Clear(); for (auto& val : t1) { *t2.Add() = val; } } template static void SetToRepeatedField(const T1& t1, T2& t2) { t2.Clear(); for (auto& val : t1) { *t2.Add() = val; } } void InitMysqlConnection(a8::mysql::Query* query);