29 lines
779 B
C++
29 lines
779 B
C++
#pragma once
|
|
|
|
namespace google
|
|
{
|
|
namespace protobuf
|
|
{
|
|
class Descriptor;
|
|
class Message;
|
|
}
|
|
}
|
|
|
|
bool ReadCsvMetaFile(const std::string& filename,
|
|
google::protobuf::Message* prototype,
|
|
std::function<void (google::protobuf::Message*)> push_back_func);
|
|
|
|
template <typename T>
|
|
bool ReadCsvMetaFile(const std::string& filename, std::list<T>& meta_list)
|
|
{
|
|
T dummy;
|
|
return ReadCsvMetaFile(filename,
|
|
&dummy,
|
|
[&meta_list] (google::protobuf::Message* msg)
|
|
{
|
|
T t;
|
|
t.CopyFrom(*msg);
|
|
meta_list.emplace_back(t);
|
|
});
|
|
}
|