- template <typename T>
- inline void write(std::string& s, const T& obj)
- {
- /* Assume anything not specialized has a to_string() method */
- s += to_string (obj);
- }
-
- template <>
- inline void write(std::string& s, const int64_t& obj)
- {
- char buffer[64];
-#ifdef DCPOMATIC_WINDOWS
- __mingw_snprintf(buffer, 64, "%" PRId64, obj);
-#else
- snprintf(buffer, 64, "%" PRId64, obj);
-#endif
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const int& obj)
- {
- char buffer[64];
- snprintf(buffer, 64, "%d", obj);
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const unsigned int& obj)
- {
- char buffer[64];
- snprintf(buffer, 64, "%ud", obj);
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const long unsigned int& obj)
- {
- char buffer[64];
- snprintf(buffer, 64, "%lu", obj);
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const float& obj)
- {
- char buffer[64];
- snprintf(buffer, 64, "%f", obj);
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const char& obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, const double& obj)
- {
- char buffer[64];
- snprintf(buffer, 64, "%f", obj);
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, char const * const & obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, char* const & obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, const std::string& obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, const boost::filesystem::path & obj)
- {
- s += obj.string();
- }
-