Formattingt fixes

This commit is contained in:
Marian Krivos
2015-08-22 21:48:17 +02:00
parent 5c0ab24c41
commit 5865c9f383
4 changed files with 305 additions and 244 deletions

View File

@@ -1,4 +1,18 @@
// file : cutl/xml/XMLStreamParser.cxx
//
// XMLStreamParser.cpp
//
// $Id$
//
// Library: XML
// Package: XML
// Module: XMLStreamParser
//
// Definition of the XMLStreamParser class.
//
// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
@@ -77,6 +91,24 @@ ostream& operator<<(ostream& os, XMLStreamParser::EventType e)
}
XMLStreamParser::XMLStreamParser(std::istream& is, const std::string& iname, FeatureType f)
: size_(0), iname_(iname), feature_(f)
{
data_.is = &is;
init();
}
XMLStreamParser::XMLStreamParser(const void* data, std::size_t size, const std::string& iname, FeatureType f)
: size_(size), iname_(iname), feature_(f)
{
assert(data != 0 && size != 0);
data_.buf = data;
init();
}
XMLStreamParser::~XMLStreamParser()
{
if (p_ != 0)
@@ -297,7 +329,7 @@ string XMLStreamParser::element()
string XMLStreamParser::element(const QName& qn, const string& dv)
{
if (peek() == StartElement && qname() == qn)
if (peek() == StartElement && getQName() == qn)
{
next();
return element();
@@ -906,5 +938,6 @@ void XMLCALL XMLStreamParser::end_namespace_decl_(void* v, const XML_Char* prefi
p.end_ns_.back().prefix() = (prefix != 0 ? prefix : "");
}
}
}

View File

@@ -147,6 +147,12 @@ void XMLStreamSerializer::startAttribute(const string& ns, const string& name)
}
const std::string& XMLStreamSerializer::outputName() const
{
return _oname;
}
void XMLStreamSerializer::endAttribute()
{
if (genxStatus e = genxEndAttribute(_writer))