bool GetContent(const std::string &file_name, std::string *content) {
std::ifstream fin(file_name);
if (!fin) {
return false;
}
std::stringstream str_stream;
str_stream << fin.rdbuf();
*content = str_stream.str();
return true;
}
标签:std,string,stream,Get,content,file
From: https://www.cnblogs.com/sunwenqi/p/16991267.html