summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Base/format.h')
-rw-r--r--Swiften/Base/format.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/Swiften/Base/format.h b/Swiften/Base/format.h
new file mode 100644
index 0000000..9e242ff
--- /dev/null
+++ b/Swiften/Base/format.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <boost/format.hpp>
+
+namespace Swift {
+ inline boost::format format(const std::string& s) {
+ using namespace boost::io;
+ boost::format fmter(s);
+ fmter.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
+ return fmter;
+ }
+}