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