Skip to content

Commit 698d09e

Browse files
author
Kjell Ahlstedt
committed
Parser, Validator: Make handle_exception() private
* libxml++/exceptions/wrapped_exception.h: Added comment. * libxml++/parsers/parser.h: * libxml++/validators/validator.h: Make handle_exception() private. Then it will certainly not be considered added API, and it can be included in libxml++ 2.40.1. Bug #757042.
1 parent 4b33a21 commit 698d09e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

libxml++/exceptions/wrapped_exception.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace xmlpp
3131
#ifndef DOXYGEN_SHOULD_SKIP_THIS
3232
/** Helper class for propagating an exception through C code.
3333
* Should not be used by applications.
34+
* Does not exist in systems that don't support std::exception_ptr.
3435
*
3536
* @newin{2,40}
3637
*/

libxml++/parsers/parser.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ extern "C" {
2626

2727
namespace xmlpp {
2828

29+
class SaxParserCallback; // Remove, when handle_exception() is made protected.
30+
2931
/** XML parser.
3032
*
3133
*/
@@ -163,10 +165,8 @@ class Parser : NonCopyable
163165
virtual void on_validity_warning(const Glib::ustring& message);
164166

165167
//TODO: When we can break ABI/API, remove handleException() and make
166-
// handle_exception() virtual.
168+
// handle_exception() protected virtual.
167169
virtual void handleException(const exception& e);
168-
/// To be called in an exception handler.
169-
void handle_exception();
170170
virtual void check_for_exception();
171171

172172
//TODO: In a future API/ABI-break, change the name of this function to
@@ -204,6 +204,11 @@ class Parser : NonCopyable
204204
//bool include_default_attributes_;
205205
//int set_options_;
206206
//int clear_options_;
207+
208+
private:
209+
friend SaxParserCallback; // Remove, when handle_exception() is made protected.
210+
/// To be called in an exception handler.
211+
void handle_exception();
207212
};
208213

209214
/** Equivalent to Parser::parse_stream().

libxml++/validators/validator.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ class Validator : NonCopyable
3838
virtual void on_validity_warning(const Glib::ustring& message);
3939

4040
//TODO: When we can break ABI/API, remove handleException() and make
41-
// handle_exception() virtual.
41+
// handle_exception() protected virtual.
4242
virtual void handleException(const exception& e);
43-
/// To be called in an exception handler.
44-
void handle_exception();
4543
virtual void check_for_exception();
4644
virtual void check_for_validity_messages();
4745

@@ -52,6 +50,10 @@ class Validator : NonCopyable
5250
exception* exception_;
5351
Glib::ustring validate_error_;
5452
Glib::ustring validate_warning_; //Built gradually - used in an exception at the end of parsing.
53+
54+
private:
55+
/// To be called in an exception handler.
56+
void handle_exception();
5557
};
5658

5759
} // namespace xmlpp

0 commit comments

Comments
 (0)