comparison irccd-test/main.cpp @ 729:e08bfc940c54

Core: remove string_util::sprintf
author David Demelier <markand@malikania.fr>
date Wed, 18 Jul 2018 13:09:22 +0200
parents 2007a37d7e1a
children fe3d80412701
comparison
equal deleted inserted replaced
728:ae88795feb99 729:e08bfc940c54
24 #include <string> 24 #include <string>
25 #include <unordered_map> 25 #include <unordered_map>
26 26
27 #include <boost/algorithm/string/trim.hpp> 27 #include <boost/algorithm/string/trim.hpp>
28 #include <boost/filesystem.hpp> 28 #include <boost/filesystem.hpp>
29 #include <boost/format.hpp>
29 30
30 #if defined(IRCCD_HAVE_LIBEDIT) 31 #if defined(IRCCD_HAVE_LIBEDIT)
31 # include <histedit.h> 32 # include <histedit.h>
32 #endif 33 #endif
33 34
43 #include <irccd/test/debug_server.hpp> 44 #include <irccd/test/debug_server.hpp>
44 45
45 #if defined(IRCCD_HAVE_JS) 46 #if defined(IRCCD_HAVE_JS)
46 # include <irccd/js/js_plugin.hpp> 47 # include <irccd/js/js_plugin.hpp>
47 #endif 48 #endif
49
50 using boost::format;
51 using boost::str;
48 52
49 namespace irccd { 53 namespace irccd {
50 54
51 namespace su = string_util; 55 namespace su = string_util;
52 56
605 it = result.find("--config"); 609 it = result.find("--config");
606 if (it != result.end()) { 610 if (it != result.end()) {
607 try { 611 try {
608 daemon->set_config(it->second); 612 daemon->set_config(it->second);
609 } catch (const std::exception& ex) { 613 } catch (const std::exception& ex) {
610 throw std::runtime_error(su::sprintf("%s: %s", it->second, ex.what())); 614 throw std::runtime_error(str(format("%1%: %2%") % it->second % ex.what()));
611 } 615 }
612 } 616 }
613 } 617 }
614 618
615 // }}} 619 // }}}