1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2010-2013 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland.
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
10 #ifndef FILE_TO_STRING_HPP
11 #define FILE_TO_STRING_HPP
18 inline std::string file_to_string(std::string const& filename)
22 std::ifstream cpp_file(filename.c_str());
23 if (cpp_file.is_open())
25 while (! cpp_file.eof() )
28 std::getline(cpp_file, line);
29 result += line + "\n";
36 #endif // FILE_TO_STRING_HPP