Added operator<<(const bool&), to get proper true/false written

instead of 0/1 - but it doesn't work yet :(
This commit is contained in:
hiker
2014-02-11 09:52:46 +11:00
parent 83bc8c83e6
commit 2fe21fc3b2

View File

@@ -19,9 +19,12 @@
#ifndef HEADER_UTF_WRITER_HPP
#define HEADER_UTF_WRITER_HPP
#include <fstream>
#include "utils/string_utils.hpp"
#include <irrString.h>
#include <fstream>
/**
* \brief utility class used to write wide (UTF-16 or UTF-32, depending of size of wchar_t) XML files
* \note the inner base class (ofstream) is not public because it will take in any kind of data, and
@@ -49,8 +52,13 @@ public:
return operator<< (irr::core::stringw(txt.c_str()));
} // operator<<(std::string)
// ------------------------------------------------------------------------
UTFWriter& operator<< (const bool &b)
{
return operator<<(StringUtils::toString(b));
}
// ------------------------------------------------------------------------
template<typename T>
UTFWriter& operator<< (const T t)
UTFWriter& operator<< (const T &t)
{
return operator<<(StringUtils::toString<T>(t));
} // operator<< (template)