nuclear@0: nuclear@0: nuclear@0: nuclear@0: /* DEPRECATED! - use code/TinyFormatter.h instead. nuclear@0: * nuclear@0: * nuclear@0: * */ nuclear@0: nuclear@0: #ifndef AI_BOOST_FORMAT_DUMMY_INCLUDED nuclear@0: #define AI_BOOST_FORMAT_DUMMY_INCLUDED nuclear@0: nuclear@0: #if (!defined BOOST_FORMAT_HPP) || (defined ASSIMP_FORCE_NOBOOST) nuclear@0: nuclear@0: #include nuclear@0: #include nuclear@0: nuclear@0: namespace boost nuclear@0: { nuclear@0: nuclear@0: nuclear@0: class format nuclear@0: { nuclear@0: public: nuclear@0: format (const std::string& _d) nuclear@0: : d(_d) nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: template nuclear@0: format& operator % (T in) nuclear@0: { nuclear@0: // XXX add replacement for boost::lexical_cast? nuclear@0: nuclear@0: std::ostringstream ss; nuclear@0: ss << in; // note: ss cannot be an rvalue, or the global operator << (const char*) is not called for T == const char*. nuclear@0: chunks.push_back( ss.str()); nuclear@0: return *this; nuclear@0: } nuclear@0: nuclear@0: nuclear@0: operator std::string () const { nuclear@0: std::string res; // pray for NRVO to kick in nuclear@0: nuclear@0: size_t start = 0, last = 0; nuclear@0: nuclear@0: std::vector::const_iterator chunkin = chunks.begin(); nuclear@0: nuclear@0: for ( start = d.find('%');start != std::string::npos; start = d.find('%',last)) { nuclear@0: res += d.substr(last,start-last); nuclear@0: last = start+2; nuclear@0: if (d[start+1] == '%') { nuclear@0: res += "%"; nuclear@0: continue; nuclear@0: } nuclear@0: nuclear@0: if (chunkin == chunks.end()) { nuclear@0: break; nuclear@0: } nuclear@0: nuclear@0: res += *chunkin++; nuclear@0: } nuclear@0: res += d.substr(last); nuclear@0: return res; nuclear@0: } nuclear@0: nuclear@0: private: nuclear@0: std::string d; nuclear@0: std::vector chunks; nuclear@0: }; nuclear@0: nuclear@0: inline std::string str(const std::string& s) { nuclear@0: return s; nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: nuclear@0: #else nuclear@0: # error "format.h was already included" nuclear@0: #endif // nuclear@0: #endif // !! AI_BOOST_FORMAT_DUMMY_INCLUDED nuclear@0: