Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/date_time/string_convert.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
rev | line source |
---|---|
Chris@16 | 1 #ifndef _STRING_CONVERT_HPP___ |
Chris@16 | 2 #define _STRING_CONVERT_HPP___ |
Chris@16 | 3 |
Chris@16 | 4 /* Copyright (c) 2005 CrystalClear Software, Inc. |
Chris@16 | 5 * Subject to the Boost Software License, Version 1.0. (See accompanying |
Chris@16 | 6 * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 7 * Author: Jeff Garland, Bart Garst |
Chris@16 | 8 * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ |
Chris@16 | 9 */ |
Chris@16 | 10 |
Chris@16 | 11 #include "boost/date_time/compiler_config.hpp" |
Chris@16 | 12 #include <string> |
Chris@16 | 13 |
Chris@16 | 14 namespace boost { |
Chris@16 | 15 namespace date_time { |
Chris@16 | 16 |
Chris@16 | 17 //! Converts a string from one value_type to another |
Chris@16 | 18 /*! Converts a wstring to a string (or a string to wstring). If both template parameters |
Chris@16 | 19 * are of same type, a copy of the input string is returned. */ |
Chris@16 | 20 template<class InputT, class OutputT> |
Chris@16 | 21 inline |
Chris@16 | 22 std::basic_string<OutputT> convert_string_type(const std::basic_string<InputT>& inp_str) |
Chris@16 | 23 { |
Chris@16 | 24 typedef std::basic_string<InputT> input_type; |
Chris@16 | 25 typedef std::basic_string<OutputT> output_type; |
Chris@16 | 26 output_type result; |
Chris@16 | 27 result.insert(result.begin(), inp_str.begin(), inp_str.end()); |
Chris@16 | 28 return result; |
Chris@16 | 29 } |
Chris@16 | 30 |
Chris@16 | 31 }} // namespace boost::date_time |
Chris@16 | 32 |
Chris@16 | 33 #endif // _STRING_CONVERT_HPP___ |