From b08e6b4c723efef245903caca49c2dafb11f8722 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 22 Jul 2016 09:17:06 +0100 Subject: Fix GPL boilerplate. Add locked_sstream dependency. Remove Document::read_stream; improve Document::read_string efficiency. Use locked_stringstream instead of plain one to try to fix DCP-o-matic crashes on OS X. --- src/cxml.cc | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/cxml.cc') diff --git a/src/cxml.cc b/src/cxml.cc index 567dc50..3248324 100644 --- a/src/cxml.cc +++ b/src/cxml.cc @@ -1,32 +1,29 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2016 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of libcxml. + + libcxml is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + libcxml is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with libcxml. If not, see . */ -#include -#include #include #include #include #include "cxml.h" using std::string; -using std::stringstream; -using std::istream; using std::list; using boost::shared_ptr; using boost::optional; @@ -264,18 +261,10 @@ cxml::Document::read_file (boost::filesystem::path file) take_root_node (); } -void -cxml::Document::read_stream (istream& stream) -{ - _parser->parse_stream (stream); - take_root_node (); -} - void cxml::Document::read_string (string s) { - stringstream t (s); - _parser->parse_stream (t); + _parser->parse_memory (s); take_root_node (); } -- cgit v1.2.3