summaryrefslogtreecommitdiffstats
blob: a10ce2e833c665cd450e0b3fd1fc1bfb8c7efec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright (c) 2010 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#pragma once

#include <boost/format.hpp>
#include <iostream>

namespace Swift {
	inline boost::format format(const std::string& s) {
		using namespace boost::io;
		try {
			boost::format fmter(s);
			fmter.exceptions(no_error_bits);
			return fmter;
		}
		catch (...) {
			std::cerr << "Error: Invalid translation: " << s << std::endl;
			throw;
		}
	}
}