Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
SAXReader.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_DataExchange_XML_SAXReader_h_
5#define _Stroika_Foundation_DataExchange_XML_SAXReader_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
13#include "Stroika/Foundation/Execution/ProgressMonitor.h"
15
16/**
17 * \file
18 */
19
20namespace Stroika::Foundation::DataExchange::XML::Providers {
21 struct ISAXProvider;
22};
23namespace Stroika::Foundation::DataExchange::XML {
24
25 /**
26 * Parse will throw an exception if it encounters any errors parsing.
27 *
28 * @see ObjectReaderRegistry for examples of one way to use this
29 *
30 * \note though we support using incompatible schema/saxProvider pairs, doing so incurs a significant performance penalty.
31 */
32 void SAXParse (const Providers::ISAXProvider& saxProvider, const Streams::InputStream::Ptr<byte>& in,
33 StructuredStreamEvents::IConsumer* callback = nullptr, const Schema::Ptr& schema = nullptr,
34 Execution::ProgressMonitor::Updater progress = nullptr);
35#if qStroika_Foundation_DataExchange_XML_SupportParsing
36 void SAXParse (const Streams::InputStream::Ptr<byte>& in, StructuredStreamEvents::IConsumer* callback = nullptr,
37 const Schema::Ptr& schema = nullptr, Execution::ProgressMonitor::Updater progress = nullptr);
38#endif
39
40#if qStroika_Foundation_DataExchange_XML_SupportParsing
41 [[deprecated ("Since Stroika v3.0d5 use address of callback")]] inline void
42 SAXParse (const Streams::InputStream::Ptr<byte>& in, StructuredStreamEvents::IConsumer& callback, const Schema::Ptr& schema = nullptr)
43 {
44 SAXParse (in, &callback, schema);
45 }
46#endif
47
48}
49
50/*
51 ********************************************************************************
52 ***************************** Implementation Details ***************************
53 ********************************************************************************
54 */
55#include "SAXReader.inl"
56
57#endif /*_Stroika_Foundation_DataExchange_XML_SAXReader_h_*/
void SAXParse(const Providers::ISAXProvider &saxProvider, const Streams::InputStream::Ptr< byte > &in, StructuredStreamEvents::IConsumer *callback=nullptr, const Schema::Ptr &schema=nullptr, Execution::ProgressMonitor::Updater progress=nullptr)
Definition SAXReader.cpp:45