Qualify std::ifstream and std::ofstream
Starting with Boost 1.60.0 <boost/filesystem.hpp> includes <boost/filesystem/fstream.hpp>, which declares ifstream and ofstream types that make the unqualified names ifstream and ofstream ambiguous. The names must be qualified to refer to the std versions.
This commit is contained in:
committed by
Lothar May
parent
2b372d0019
commit
65eea1d6ec
@@ -61,7 +61,7 @@ using namespace std;
|
||||
using namespace boost::filesystem;
|
||||
|
||||
struct AvatarFileState {
|
||||
ifstream inputStream;
|
||||
std::ifstream inputStream;
|
||||
};
|
||||
|
||||
AvatarManager::AvatarManager(bool useExternalServer, const std::string &externalServerAddress,
|
||||
@@ -363,7 +363,7 @@ AvatarManager::StoreAvatarInCache(const MD5Buf &md5buf, AvatarFileType avatarFil
|
||||
path tmpPath(cacheDir);
|
||||
tmpPath /= (md5buf.ToString() + ext);
|
||||
string fileName(tmpPath.file_string());
|
||||
ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
|
||||
std::ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
|
||||
if (!o.fail()) {
|
||||
o.write((const char *)data, size);
|
||||
o.close();
|
||||
|
||||
@@ -67,7 +67,7 @@ void
|
||||
internal_log_err(const string &msg)
|
||||
{
|
||||
if (!g_logFile.empty()) {
|
||||
ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
|
||||
std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
|
||||
if (!o.fail()) {
|
||||
o << second_clock::local_time() << " ERR: " << msg;
|
||||
o.flush();
|
||||
@@ -80,7 +80,7 @@ internal_log_msg(const std::string &msg)
|
||||
{
|
||||
if (g_logLevel) {
|
||||
if (!g_logFile.empty()) {
|
||||
ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
|
||||
std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
|
||||
if (!o.fail())
|
||||
o << second_clock::local_time() << " MSG: " << msg;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ internal_log_level(const std::string &msg, int logLevel)
|
||||
{
|
||||
if (g_logLevel >= logLevel) {
|
||||
if (!g_logFile.empty()) {
|
||||
ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
|
||||
std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
|
||||
if (!o.fail())
|
||||
o << second_clock::local_time() << " OUT: " << msg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user