Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:39

0001 #ifndef _STRING_CONVERT_HPP___
0002 #define _STRING_CONVERT_HPP___
0003 
0004 /* Copyright (c) 2005 CrystalClear Software, Inc.
0005  * Subject to the Boost Software License, Version 1.0. (See accompanying
0006  * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
0007  * Author: Jeff Garland, Bart Garst
0008  * $Date$
0009  */
0010 
0011 #include "boost/date_time/compiler_config.hpp"
0012 #include <string>
0013 
0014 namespace boost {
0015 namespace date_time {
0016 
0017   //! Converts a string from one value_type to another
0018   /*! Converts a wstring to a string (or a string to wstring). If both template parameters 
0019    * are of same type, a copy of the input string is returned. */
0020   template<class InputT, class OutputT>
0021   inline
0022   std::basic_string<OutputT> convert_string_type(const std::basic_string<InputT>& inp_str)
0023   {
0024     typedef std::basic_string<OutputT> output_type;
0025     output_type result;
0026     result.insert(result.begin(), inp_str.begin(), inp_str.end());
0027     return result;
0028   }
0029   
0030 }} // namespace boost::date_time
0031 
0032 #endif // _STRING_CONVERT_HPP___