6 #include "application.h"
19 return Application::Instance() ;
28 }
catch (std::bad_alloc) {
29 logwriter->
error(
"bad alloc thrown by app()");
45 enum { BUFSIZE = 2048 } ;
52 _vsnprintf(sbuf, BUFSIZE, fmt, args) ;
54 vsprintf(sbuf, fmt, args) ;
66 void error(
const std::string& msg)
115 #endif // WITH_HTML_LOGS
120 mutex_t Unit::units_mutex;
124 Application::ApplicationDestroy() ;
125 FactoryBase::deleteFactories();
186 doublereal
toSI(std::string unit)
188 doublereal f = Unit::units()->toSI(unit);
192 throw CanteraError(
"toSI",
"unknown unit string: "+unit);
199 doublereal f = Unit::units()->actEnergyToSI(unit);
209 ctroot = getenv(
"CANTERA_ROOT");
211 return string(ctroot);
214 return string(CANTERA_ROOT);
227 static void split_at_pound(
const std::string& src, std::string& file, std::string&
id)
229 string::size_type ipound = src.find(
'#');
231 id = src.substr(ipound+1,src.size());
232 file = src.substr(0,ipound);
241 std::string fname, idstr;
246 "no file name given. file_ID = "+file_ID);
247 db = root->
findID(idstr, 3);
251 "get_XML_File failed trying to open "+fname);
252 db = doc->
findID(idstr, 3);
256 "id tag '"+idstr+
"' not found.");
262 const std::string& file_ID,
265 string fname, idTarget;
283 std::vector<FactoryBase*> FactoryBase::s_vFactoryRegistry;