This commit is contained in:
aozhiwei 2019-04-13 19:49:17 +08:00
parent fe005a6c44
commit 35d98ffd0b

View File

@ -20,13 +20,19 @@ namespace a8
namespace f8
{
typedef void (*ReadCsvMetaFileCallback)(const std::string&);
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)
bool ReadCsvMetaFile(const std::string& filename, std::list<T>& meta_list,
ReadCsvMetaFileCallback callback_func = nullptr)
{
if (callback_func) {
callback_func(filename);
}
T dummy;
return ReadCsvMetaFile(filename,
&dummy,