summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2013-12-20 16:36:42 +0000
committerMichael Meeks <michael.meeks@collabora.com>2013-12-20 16:37:03 +0000
commit169eb25c86c28aae02345c92e04572abbf08d77a (patch)
tree1c6f4163e1d99d0bd00c6b0f608bdf77d390223c /sax
parentfe506f34f2dccb6562935fe4dfbc1fe6d609dec8 (diff)
fastparser:: move Entity:: code into the anonymous namespace.
Change-Id: I564e35aa63e4c01cc1a0fb45f674dc1a2a0e89ec
Diffstat (limited to 'sax')
-rw-r--r--sax/source/fastparser/fastparser.cxx92
1 files changed, 46 insertions, 46 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 3b93765c6341..9171652c3aed 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -528,6 +528,52 @@ Event& Entity::getEvent( CallbackType aType )
return rEvent;
}
+// throw an exception, but avoid callback if
+// during a threaded produce
+void Entity::throwException( const ::rtl::Reference< FastLocatorImpl > &xDocumentLocator,
+ bool mbDuringParse )
+{
+ // Error during parsing !
+ SAXParseException aExcept(
+ lclGetErrorMessage( XML_GetErrorCode( mpParser ),
+ xDocumentLocator->getSystemId(),
+ xDocumentLocator->getLineNumber() ),
+ Reference< XInterface >(),
+ Any( &maSavedException, getCppuType( &maSavedException ) ),
+ xDocumentLocator->getPublicId(),
+ xDocumentLocator->getSystemId(),
+ xDocumentLocator->getLineNumber(),
+ xDocumentLocator->getColumnNumber()
+ );
+
+ // error handler is set, it may throw the exception
+ if( !mbDuringParse || !mbEnableThreads )
+ {
+ if (mxErrorHandler.is() )
+ mxErrorHandler->fatalError( Any( aExcept ) );
+ }
+
+ // error handler has not thrown, but parsing must stop => throw ourselves
+ throw aExcept;
+}
+
+// In the single threaded case we emit events via our C
+// callbacks, so any exception caught must be queued up until
+// we can safely re-throw it from our C++ parent of parse()
+//
+// If multi-threaded, we need to push an EXCEPTION event, at
+// which point we transfer ownership of maSavedException to
+// the consuming thread.
+void Entity::saveException( const Exception &e )
+{
+ // only store the first exception
+ if( !maSavedException.hasValue() )
+ {
+ maSavedException <<= e;
+ XML_StopParser( mpParser, /* resumable? */ XML_FALSE );
+ }
+}
+
} // namespace
namespace sax_fastparser {
@@ -1009,35 +1055,6 @@ const Entity& FastSaxParserImpl::getEntity() const
return maEntities.top();
}
-// throw an exception, but avoid callback if
-// during a threaded produce
-void Entity::throwException( const ::rtl::Reference< FastLocatorImpl > &xDocumentLocator,
- bool mbDuringParse )
-{
- // Error during parsing !
- SAXParseException aExcept(
- lclGetErrorMessage( XML_GetErrorCode( mpParser ),
- xDocumentLocator->getSystemId(),
- xDocumentLocator->getLineNumber() ),
- Reference< XInterface >(),
- Any( &maSavedException, getCppuType( &maSavedException ) ),
- xDocumentLocator->getPublicId(),
- xDocumentLocator->getSystemId(),
- xDocumentLocator->getLineNumber(),
- xDocumentLocator->getColumnNumber()
- );
-
- // error handler is set, it may throw the exception
- if( !mbDuringParse || !mbEnableThreads )
- {
- if (mxErrorHandler.is() )
- mxErrorHandler->fatalError( Any( aExcept ) );
- }
-
- // error handler has not thrown, but parsing must stop => throw ourselves
- throw aExcept;
-}
-
// starts parsing with actual parser !
void FastSaxParserImpl::parse()
{
@@ -1068,23 +1085,6 @@ void FastSaxParserImpl::parse()
produce( DONE );
}
-// In the single threaded case we emit events via our C
-// callbacks, so any exception caught must be queued up until
-// we can safely re-throw it from our C++ parent of parse()
-//
-// If multi-threaded, we need to push an EXCEPTION event, at
-// which point we transfer ownership of maSavedException to
-// the consuming thread.
-void Entity::saveException( const Exception &e )
-{
- // only store the first exception
- if( !maSavedException.hasValue() )
- {
- maSavedException <<= e;
- XML_StopParser( mpParser, /* resumable? */ XML_FALSE );
- }
-}
-
//------------------------------------------
//
// The C-Callbacks