Compare commits

...

33 Commits

Author SHA1 Message Date
Arseny Kapoulkine
b2b4664030 docs: Adjust docs wrt parse_merge_pcdata x parse_embed_pcdata
parse_merge_pcdata expects to find node_pcdata nodes which aren't
present when parse_embed_pcdata is active. For now we mention this in
the documentation; changing this is possible in the future, but carries
a small performance penalty so it requires a specific use case.

Fixes #600
2024-01-26 09:23:26 -08:00
Arseny Kapoulkine
3cc2daf449 Update year to 2024 everywhere
... except .html files that will be regenerated later.
2024-01-26 09:18:48 -08:00
Arseny Kapoulkine
96aebcb8ae
Merge pull request #604 from zeux/ndk-warnfix
Fix -Wshorten-64-to-32 warning on Android NDK when targeting x86
2023-12-23 10:48:31 -08:00
Arseny Kapoulkine
86591a97c3 Extract length validation and conversion function into a templated function
Since there's no reasonable way for us to figure out what the type of
stat::st_size is on Android NDK without resorting to C++11 auto /
non-standard decltype extensions, we're going to resort to a templated
function that can deduce the length type. The rest of the validation and
conversion logic is preserved as is.
2023-12-23 09:30:57 -08:00
Arseny Kapoulkine
8fef4591be Fix -Wshorten-64-to-32 warning on Android NDK when targeting x86
stat.h defines struct stat to use long long on Android NDK when
targeting x86; off_t however is defined as long, which is 32-bit (unlike
other Unix-like platforms). This results in a narrowing conversion which
produces a warning, and can also result in silently reading a prefix of
a huge file instead of a clean "out of memory" error.

There's no way for us to preserve the type exactly but always widening
to long long should be safe; get_file_size will proceed to check if
length actually fits into size_t which is what we ultimately need, and
that overflow check will fail on files that are >4 GB in size.
2023-12-20 11:19:42 -08:00
Arseny Kapoulkine
cf466ce2a2
Merge pull request #595 from zeux/stl-defarg
Use cleaner references to STL classes
2023-11-16 12:42:22 -08:00
Arseny Kapoulkine
499750ad95
Merge pull request #596 from zeux/appvmp
AppVeyor build optimizations
2023-11-16 12:32:28 -08:00
Arseny Kapoulkine
cd420ab193 Use make -j2 for mingw builds on AppVeyor 2023-11-16 12:12:56 -08:00
Arseny Kapoulkine
d99aa003ba Restrict AppVeyor builds to master branch
This avoids duplicate builds on PRs submitted from a branch in the same
repository.
2023-11-16 12:09:18 -08:00
Arseny Kapoulkine
1e3d6f15f5 tests: Add /MP to AppVeyor builds to try to reduce build time 2023-11-16 11:27:40 -08:00
Arseny Kapoulkine
2e8a2a4e1c tests: Work around -Wself-move in new gcc
We do want to test self-move; fortunately, hiding the object reference
behind a separate pointer variable silences the warning.
2023-11-16 10:54:53 -08:00
Arseny Kapoulkine
0bd2848f33 Use cleaner references to STL classes
The explicit specification of default template arguments is repetitive
and dates back to the versions of pugixml that tried to forward-declare
all STL classes manually, which ran into issues with default arguments
in some STL versions.

We've since abandoned this idea and use <string>/<iosfwd> includes, as
such it should be fine to rely on default arguments.

Note: while we could use std::wstring, this had compatibility issues
with some very early versions of Android SDK. Out of abundance of
caution, we keep basic_i/ostream and basic_string in tact. We could use
std::string but we might need to replace these in char8 mode if that
ever gets merged.
2023-11-16 10:51:20 -08:00
Arseny Kapoulkine
43d7d568a7
Merge pull request #594 from SoapGentoo/Wuseless-cast
Fix `-Wuseless-cast`
2023-11-14 07:13:09 -08:00
David Seifert
44236fef2c
Fix -Wuseless-cast 2023-11-13 20:53:44 -08:00
Arseny Kapoulkine
6909df2478
Merge pull request #590 from zeux/sanfuzz
Update config=sanitize and fuzz targets
2023-10-22 11:18:08 -07:00
Arseny Kapoulkine
b15bc6bf1f Update config=sanitize and fuzz targets
We used to need to silence float-divide-by-zero and float-cast-overflow
sanitizers since clang used a finite valid floating point value range.
Fortunately, since clang-9 UBSAN properly handles various primitive
operations per IEEE-754 so we no longer need this workaround.

Also use fork=16 mode for fuzz targets to make it easier to run fuzzing
locally.
2023-10-22 10:07:52 -07:00
Arseny Kapoulkine
33f709379a
Merge pull request #551 from silvergasp/master
fuzzer: excersizes query code on xml doc
2023-10-21 12:29:22 -07:00
Arseny Kapoulkine
4d42ba7a60
Update fuzz_xpath.cpp
Remove unused variables
2023-10-21 11:20:03 -07:00
Arseny Kapoulkine
d75a081aa3
Update fuzz_xpath.cpp
Fix code style, no exceptions, other tweaks.
2023-10-21 11:11:11 -07:00
Arseny Kapoulkine
1ade1d4bea
Merge pull request #586 from PhilipBotha/fix/nullptr_const_zero
Replaced 0 with PUGIXML_NULL when a nullptr would have been needed.
2023-10-19 19:21:08 -07:00
Arseny Kapoulkine
94b19a3c45 Fix indentation changes 2023-10-15 19:25:56 -07:00
Arseny Kapoulkine
76dec417a6 Silence -Wzero-as-null-pointer-constant for clang
clang does not handle NULL the same way as gcc, so for now we silence
the warning.
2023-10-15 19:19:36 -07:00
Arseny Kapoulkine
6699559320 Replace 0 with NULL for some MSVC-specific code 2023-10-15 19:17:37 -07:00
Arseny Kapoulkine
dab3a2f858 Replace 0 with NULL for compact and wchar mode specific code 2023-10-15 19:13:34 -07:00
Arseny Kapoulkine
60d9656cb7 Replace PUGIXML_NULL with NULL and fix a couple extra stragglers 2023-10-15 19:10:34 -07:00
Philip
08b966e24f Fixed zero as nullptr constant in macro.
Removed white space that was changed.
2023-10-14 09:06:20 +02:00
Arseny Kapoulkine
2e357d19a3
Merge pull request #585 from ilya-lavrenov/install-rules
Added cmake option to disable install rules
2023-10-13 20:14:59 -07:00
Philip Botha
b138778fd9 Replaced 0 with PUGIXML_NULL when appropriate.
Added the suffix UZ to size_t.

Added fixed GCC warning about using const literal zero in place of nullptr (-Wzero-as-null-pointer-constant).
2023-10-12 15:49:18 +02:00
Ilya Lavrenov
3cfe51b72d Added cmake option to disable install rules 2023-10-12 02:15:05 +04:00
Arseny Kapoulkine
ef856bf975
Merge pull request #584 from richardapeters/master
build: only include CTest when building the pugixml tests
2023-10-06 06:14:27 -07:00
Richard Peters
efce4a8d7a Remove BUILD_TESTING as prerequisite for the PUGIXML_BUILD_TESTS; it was always set by including CTest, now CTest is conditionally included later on 2023-10-06 10:02:15 +02:00
Richard Peters
a468d5c438 Only include CTest when building the pugixml tests 2023-10-06 09:51:29 +02:00
Nathaniel Brough
9d8d193288 tests: excersizes query code on xml doc 2023-03-09 17:46:23 -08:00
17 changed files with 390 additions and 355 deletions

View File

@ -10,7 +10,6 @@ project(pugixml VERSION 1.14 LANGUAGES CXX)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(CMakeDependentOption) include(CMakeDependentOption)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CTest)
cmake_dependent_option(PUGIXML_USE_VERSIONED_LIBDIR cmake_dependent_option(PUGIXML_USE_VERSIONED_LIBDIR
"Use a private subdirectory to install the headers and libraries" OFF "Use a private subdirectory to install the headers and libraries" OFF
@ -26,7 +25,7 @@ cmake_dependent_option(PUGIXML_STATIC_CRT
cmake_dependent_option(PUGIXML_BUILD_TESTS cmake_dependent_option(PUGIXML_BUILD_TESTS
"Build pugixml tests" OFF "Build pugixml tests" OFF
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) "CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
# Custom build defines # Custom build defines
set(PUGIXML_BUILD_DEFINES CACHE STRING "Build defines for custom options") set(PUGIXML_BUILD_DEFINES CACHE STRING "Build defines for custom options")
@ -43,6 +42,7 @@ cmake_dependent_option(PUGIXML_BUILD_SHARED_AND_STATIC_LIBS
# Expose options from the pugiconfig.hpp # Expose options from the pugiconfig.hpp
option(PUGIXML_WCHAR_MODE "Enable wchar_t mode" OFF) option(PUGIXML_WCHAR_MODE "Enable wchar_t mode" OFF)
option(PUGIXML_COMPACT "Enable compact mode" OFF) option(PUGIXML_COMPACT "Enable compact mode" OFF)
option(PUGIXML_INSTALL "Enable installation rules" ON)
# Advanced options from pugiconfig.hpp # Advanced options from pugiconfig.hpp
option(PUGIXML_NO_XPATH "Disable XPath" OFF) option(PUGIXML_NO_XPATH "Disable XPath" OFF)
@ -194,52 +194,56 @@ endif()
configure_file(scripts/pugixml.pc.in pugixml.pc @ONLY) configure_file(scripts/pugixml.pc.in pugixml.pc @ONLY)
if (NOT DEFINED PUGIXML_RUNTIME_COMPONENT) export(TARGETS ${install-targets}
set(PUGIXML_RUNTIME_COMPONENT Runtime)
endif()
if (NOT DEFINED PUGIXML_LIBRARY_COMPONENT)
set(PUGIXML_LIBRARY_COMPONENT Library)
endif()
if (NOT DEFINED PUGIXML_DEVELOPMENT_COMPONENT)
set(PUGIXML_DEVELOPMENT_COMPONENT Development)
endif()
set(namelink-component)
if (NOT CMAKE_VERSION VERSION_LESS 3.12)
set(namelink-component NAMELINK_COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
endif()
install(TARGETS ${install-targets}
EXPORT pugixml-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${PUGIXML_RUNTIME_COMPONENT}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${PUGIXML_LIBRARY_COMPONENT} ${namelink-component}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir})
install(EXPORT pugixml-targets
NAMESPACE pugixml:: NAMESPACE pugixml::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}) FILE pugixml-targets.cmake)
export(EXPORT pugixml-targets if(PUGIXML_INSTALL)
NAMESPACE pugixml::) if (NOT DEFINED PUGIXML_RUNTIME_COMPONENT)
set(PUGIXML_RUNTIME_COMPONENT Runtime)
endif()
install(FILES if (NOT DEFINED PUGIXML_LIBRARY_COMPONENT)
"${PROJECT_BINARY_DIR}/pugixml-config-version.cmake" set(PUGIXML_LIBRARY_COMPONENT Library)
"${PROJECT_BINARY_DIR}/pugixml-config.cmake" endif()
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc if (NOT DEFINED PUGIXML_DEVELOPMENT_COMPONENT)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}) set(PUGIXML_DEVELOPMENT_COMPONENT Development)
endif()
install( set(namelink-component)
FILES if (NOT CMAKE_VERSION VERSION_LESS 3.12)
"${PROJECT_SOURCE_DIR}/src/pugiconfig.hpp" set(namelink-component NAMELINK_COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
"${PROJECT_SOURCE_DIR}/src/pugixml.hpp" endif()
DESTINATION install(TARGETS ${install-targets}
${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}) EXPORT pugixml-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${PUGIXML_RUNTIME_COMPONENT}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${PUGIXML_LIBRARY_COMPONENT} ${namelink-component}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir})
install(EXPORT pugixml-targets
NAMESPACE pugixml::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
install(FILES
"${PROJECT_BINARY_DIR}/pugixml-config-version.cmake"
"${PROJECT_BINARY_DIR}/pugixml-config.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
install(
FILES
"${PROJECT_SOURCE_DIR}/src/pugiconfig.hpp"
"${PROJECT_SOURCE_DIR}/src/pugixml.hpp"
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
endif()
if (PUGIXML_BUILD_TESTS) if (PUGIXML_BUILD_TESTS)
include(CTest)
set(fuzz-pattern "tests/fuzz_*.cpp") set(fuzz-pattern "tests/fuzz_*.cpp")
set(test-pattern "tests/*.cpp") set(test-pattern "tests/*.cpp")
if (CMAKE_VERSION VERSION_GREATER 3.11) if (CMAKE_VERSION VERSION_GREATER 3.11)

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2006-2023 Arseny Kapoulkine Copyright (c) 2006-2024 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation

View File

@ -27,7 +27,7 @@ ifeq ($(config),coverage)
endif endif
ifeq ($(config),sanitize) ifeq ($(config),sanitize)
CXXFLAGS+=-fsanitize=address,undefined -fno-sanitize=float-divide-by-zero,float-cast-overflow -fno-sanitize-recover=all CXXFLAGS+=-fsanitize=address,undefined -fno-sanitize-recover=all
LDFLAGS+=-fsanitize=address,undefined LDFLAGS+=-fsanitize=address,undefined
endif endif
@ -66,7 +66,7 @@ endif
fuzz_%: $(BUILD)/fuzz_% fuzz_%: $(BUILD)/fuzz_%
@mkdir -p build/$@ @mkdir -p build/$@
$< build/$@ tests/data_fuzz_$* -max_len=1024 -dict=tests/fuzz_$*.dict $< build/$@ tests/data_fuzz_$* -max_len=1024 -dict=tests/fuzz_$*.dict -fork=16
clean: clean:
rm -rf $(BUILD) rm -rf $(BUILD)

View File

@ -1,3 +1,7 @@
branches:
only:
- master
image: image:
- Visual Studio 2022 - Visual Studio 2022
- Visual Studio 2019 - Visual Studio 2019
@ -18,8 +22,8 @@ test_script:
- ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { .\tests\autotest-appveyor.ps1 15 } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { .\tests\autotest-appveyor.ps1 15 }
- ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2019") { .\tests\autotest-appveyor.ps1 19 } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2019") { .\tests\autotest-appveyor.ps1 19 }
- ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2022") { .\tests\autotest-appveyor.ps1 22 } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2022") { .\tests\autotest-appveyor.ps1 22 }
- ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { & C:\cygwin\bin\bash.exe -c "PATH=/usr/bin:/usr/local/bin:$PATH; make config=coverage test && bash <(curl -s https://codecov.io/bash) -f pugixml.cpp.gcov 2>&1" } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { & C:\cygwin\bin\bash.exe -c "PATH=/usr/bin:/usr/local/bin:$PATH; make -j2 config=coverage test && bash <(curl -s https://codecov.io/bash) -f pugixml.cpp.gcov 2>&1" }
- ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { & C:\cygwin\bin\bash.exe -c "PATH=/usr/bin:/usr/local/bin:$PATH; make config=coverage defines=PUGIXML_WCHAR_MODE test && bash <(curl -s https://codecov.io/bash) -f pugixml.cpp.gcov 2>&1" } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { & C:\cygwin\bin\bash.exe -c "PATH=/usr/bin:/usr/local/bin:$PATH; make -j2 config=coverage defines=PUGIXML_WCHAR_MODE test && bash <(curl -s https://codecov.io/bash) -f pugixml.cpp.gcov 2>&1" }
artifacts: artifacts:
- path: .\scripts\*.nupkg - path: .\scripts\*.nupkg

View File

@ -46,7 +46,7 @@ Thanks to *Vyacheslav Egorov* for documentation proofreading and fuzz testing.
The pugixml library is distributed under the MIT license: The pugixml library is distributed under the MIT license:
.... ....
Copyright (c) 2006-2023 Arseny Kapoulkine Copyright (c) 2006-2024 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation
@ -74,7 +74,7 @@ This means that you can freely use pugixml in your applications, both open-sourc
.... ....
This software is based on pugixml library (https://pugixml.org). This software is based on pugixml library (https://pugixml.org).
pugixml is Copyright (C) 2006-2023 Arseny Kapoulkine. pugixml is Copyright (C) 2006-2024 Arseny Kapoulkine.
.... ....
[[install]] [[install]]
@ -749,7 +749,7 @@ These flags control the resulting tree contents:
* [[parse_embed_pcdata]]`parse_embed_pcdata` determines if PCDATA contents is to be saved as element values. Normally element nodes have names but not values; this flag forces the parser to store the contents as a value if PCDATA is the first child of the element node (otherwise PCDATA node is created as usual). This can significantly reduce the memory required for documents with many PCDATA nodes. To retrieve the data you can use `xml_node::value()` on the element nodes or any of the higher-level functions like `child_value` or `text`. This flag is *off* by default. * [[parse_embed_pcdata]]`parse_embed_pcdata` determines if PCDATA contents is to be saved as element values. Normally element nodes have names but not values; this flag forces the parser to store the contents as a value if PCDATA is the first child of the element node (otherwise PCDATA node is created as usual). This can significantly reduce the memory required for documents with many PCDATA nodes. To retrieve the data you can use `xml_node::value()` on the element nodes or any of the higher-level functions like `child_value` or `text`. This flag is *off* by default.
Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is *off* by default. Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is *off* by default.
* [[parse_merge_pcdata]]`parse_merge_pcdata` determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <<parse_cdata,parse_cdata>> ,<<parse_pi,parse_pi>> ,<<parse_comments,parse_comments>> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is *off* by default. * [[parse_merge_pcdata]]`parse_merge_pcdata` determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <<parse_cdata,parse_cdata>> ,<<parse_pi,parse_pi>> ,<<parse_comments,parse_comments>> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is *off* by default. Note that this flag is not compatible with `parse_embed_pcdata`.
* [[parse_fragment]]`parse_fragment` determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid and permits multiple top-level element nodes (currently multiple top-level element nodes are also permitted when the flag is off, but that behavior should not be relied on). This flag is *off* by default. * [[parse_fragment]]`parse_fragment` determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid and permits multiple top-level element nodes (currently multiple top-level element nodes are also permitted when the flag is off, but that behavior should not be relied on). This flag is *off* by default.

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.18"> <meta name="generator" content="Asciidoctor 2.0.20">
<meta name="author" content="website, repository"> <meta name="author" content="website, repository">
<title>pugixml 1.14 manual</title> <title>pugixml 1.14 manual</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
@ -209,13 +209,10 @@ table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere} .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0} .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px} .exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
.exampleblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child{margin-bottom:0}
.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px} .sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
.sidebarblock>:first-child{margin-top:0}
.sidebarblock>:last-child{margin-bottom:0}
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center} .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0} .exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em} .literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}} @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}} @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
@ -394,7 +391,7 @@ b.conum *{color:inherit!important}
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility} dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em} h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem} p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
p{margin-bottom:1.25rem} p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em} .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc} .exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
@ -710,7 +707,7 @@ No documentation is perfect; neither is this one. If you find errors or omission
</div> </div>
<div class="literalblock"> <div class="literalblock">
<div class="content"> <div class="content">
<pre>Copyright (c) 2006-2023 Arseny Kapoulkine <pre>Copyright (c) 2006-2024 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation
@ -740,7 +737,7 @@ OTHER DEALINGS IN THE SOFTWARE.</pre>
<div class="literalblock"> <div class="literalblock">
<div class="content"> <div class="content">
<pre>This software is based on pugixml library (https://pugixml.org). <pre>This software is based on pugixml library (https://pugixml.org).
pugixml is Copyright (C) 2006-2023 Arseny Kapoulkine.</pre> pugixml is Copyright (C) 2006-2024 Arseny Kapoulkine.</pre>
</div> </div>
</div> </div>
</div> </div>
@ -1802,7 +1799,7 @@ You should use the usual bitwise arithmetics to manipulate the bitmask: to enabl
Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is <strong>off</strong> by default.</p> Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is <strong>off</strong> by default.</p>
</li> </li>
<li> <li>
<p><a id="parse_merge_pcdata"></a><code>parse_merge_pcdata</code> determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <a href="#parse_cdata">parse_cdata</a> ,<a href="#parse_pi">parse_pi</a> ,<a href="#parse_comments">parse_comments</a> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is <strong>off</strong> by default.</p> <p><a id="parse_merge_pcdata"></a><code>parse_merge_pcdata</code> determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <a href="#parse_cdata">parse_cdata</a> ,<a href="#parse_pi">parse_pi</a> ,<a href="#parse_comments">parse_comments</a> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is <strong>off</strong> by default. Note that this flag is not compatible with <code>parse_embed_pcdata</code>.</p>
</li> </li>
<li> <li>
<p><a id="parse_fragment"></a><code>parse_fragment</code> determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid and permits multiple top-level element nodes (currently multiple top-level element nodes are also permitted when the flag is off, but that behavior should not be relied on). This flag is <strong>off</strong> by default.</p> <p><a id="parse_fragment"></a><code>parse_fragment</code> determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid and permits multiple top-level element nodes (currently multiple top-level element nodes are also permitted when the flag is off, but that behavior should not be relied on). This flag is <strong>off</strong> by default.</p>
@ -6156,7 +6153,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div> </div>
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Last updated 2023-09-07 11:54:45 -0700 Last updated 2024-01-26 09:23:09 -0800
</div> </div>
</div> </div>
</body> </body>

View File

@ -255,7 +255,7 @@ If filing an issue is not possible due to privacy or other concerns, you can con
The pugixml library is distributed under the MIT license: The pugixml library is distributed under the MIT license:
.... ....
Copyright (c) 2006-2023 Arseny Kapoulkine Copyright (c) 2006-2024 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation
@ -283,5 +283,5 @@ This means that you can freely use pugixml in your applications, both open-sourc
.... ....
This software is based on pugixml library (https://pugixml.org). This software is based on pugixml library (https://pugixml.org).
pugixml is Copyright (C) 2006-2023 Arseny Kapoulkine. pugixml is Copyright (C) 2006-2024 Arseny Kapoulkine.
.... ....

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.18"> <meta name="generator" content="Asciidoctor 2.0.20">
<meta name="author" content="website, repository"> <meta name="author" content="website, repository">
<title>pugixml 1.14 quick start guide</title> <title>pugixml 1.14 quick start guide</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
@ -209,13 +209,10 @@ table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere} .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0} .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px} .exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
.exampleblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child{margin-bottom:0}
.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px} .sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
.sidebarblock>:first-child{margin-top:0}
.sidebarblock>:last-child{margin-bottom:0}
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center} .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0} .exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em} .literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}} @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}} @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
@ -394,7 +391,7 @@ b.conum *{color:inherit!important}
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility} dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em} h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem} p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
p{margin-bottom:1.25rem} p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em} .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc} .exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
@ -1057,7 +1054,7 @@ XPath functions throw <code>xpath_exception</code> objects on error; the sample
</div> </div>
<div class="literalblock"> <div class="literalblock">
<div class="content"> <div class="content">
<pre>Copyright (c) 2006-2023 Arseny Kapoulkine <pre>Copyright (c) 2006-2024 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation
@ -1087,7 +1084,7 @@ OTHER DEALINGS IN THE SOFTWARE.</pre>
<div class="literalblock"> <div class="literalblock">
<div class="content"> <div class="content">
<pre>This software is based on pugixml library (https://pugixml.org). <pre>This software is based on pugixml library (https://pugixml.org).
pugixml is Copyright (C) 2006-2023 Arseny Kapoulkine.</pre> pugixml is Copyright (C) 2006-2024 Arseny Kapoulkine.</pre>
</div> </div>
</div> </div>
</div> </div>
@ -1101,7 +1098,7 @@ pugixml is Copyright (C) 2006-2023 Arseny Kapoulkine.</pre>
</div> </div>
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Last updated 2023-09-07 11:54:46 -0700 Last updated 2024-01-26 09:23:09 -0800
</div> </div>
</div> </div>
</body> </body>

View File

@ -1,6 +1,6 @@
pugixml 1.14 - an XML processing library pugixml 1.14 - an XML processing library
Copyright (C) 2006-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) Copyright (C) 2006-2024, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
Report bugs and download new versions at https://pugixml.org/ Report bugs and download new versions at https://pugixml.org/
This is the distribution of pugixml, which is a C++ XML processing library, This is the distribution of pugixml, which is a C++ XML processing library,
@ -26,7 +26,7 @@ The distribution contains the following folders:
This library is distributed under the MIT License: This library is distributed under the MIT License:
Copyright (c) 2006-2023 Arseny Kapoulkine Copyright (c) 2006-2024 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation

View File

@ -14,7 +14,7 @@ pugixml is used by a lot of projects, both open-source and proprietary, for perf
This package contains builds for VS2013, VS2015, VS2017, VS2019 and VS2022, for both statically linked and DLL CRT; you can switch the CRT linkage in Project -> Properties -> Referenced Packages -> pugixml.</description> This package contains builds for VS2013, VS2015, VS2017, VS2019 and VS2022, for both statically linked and DLL CRT; you can switch the CRT linkage in Project -> Properties -> Referenced Packages -> pugixml.</description>
<summary>Light-weight, simple and fast XML parser for C++ with XPath support</summary> <summary>Light-weight, simple and fast XML parser for C++ with XPath support</summary>
<releaseNotes>https://pugixml.org/docs/manual.html#changes</releaseNotes> <releaseNotes>https://pugixml.org/docs/manual.html#changes</releaseNotes>
<copyright>Copyright (c) 2006-2023 Arseny Kapoulkine</copyright> <copyright>Copyright (c) 2006-2024 Arseny Kapoulkine</copyright>
<tags>native nativepackage</tags> <tags>native nativepackage</tags>
</metadata> </metadata>
</package> </package>

View File

@ -31,7 +31,7 @@ BEGIN
VALUE "FileDescription", "pugixml library\0" VALUE "FileDescription", "pugixml library\0"
VALUE "FileVersion", PUGIXML_VERSION_NUMBER VALUE "FileVersion", PUGIXML_VERSION_NUMBER
VALUE "InternalName", "pugixml.dll\0" VALUE "InternalName", "pugixml.dll\0"
VALUE "LegalCopyright", "Copyright (C) 2006-2023, by Arseny Kapoulkine\0" VALUE "LegalCopyright", "Copyright (C) 2006-2024, by Arseny Kapoulkine\0"
VALUE "OriginalFilename", "pugixml.dll\0" VALUE "OriginalFilename", "pugixml.dll\0"
VALUE "ProductName", "pugixml\0" VALUE "ProductName", "pugixml\0"
VALUE "ProductVersion", PUGIXML_VERSION_NUMBER VALUE "ProductVersion", PUGIXML_VERSION_NUMBER

View File

@ -1,7 +1,7 @@
/** /**
* pugixml parser - version 1.14 * pugixml parser - version 1.14
* -------------------------------------------------------- * --------------------------------------------------------
* Copyright (C) 2006-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Copyright (C) 2006-2024, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/ * Report bugs and download new versions at https://pugixml.org/
* *
* This library is distributed under the MIT License. See notice at the end * This library is distributed under the MIT License. See notice at the end
@ -52,7 +52,7 @@
#endif #endif
/** /**
* Copyright (c) 2006-2023 Arseny Kapoulkine * Copyright (c) 2006-2024 Arseny Kapoulkine
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/** /**
* pugixml parser - version 1.14 * pugixml parser - version 1.14
* -------------------------------------------------------- * --------------------------------------------------------
* Copyright (C) 2006-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Copyright (C) 2006-2024, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/ * Report bugs and download new versions at https://pugixml.org/
* *
* This library is distributed under the MIT License. See notice at the end * This library is distributed under the MIT License. See notice at the end
@ -138,7 +138,7 @@ namespace pugi
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
// String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE // String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE
typedef std::basic_string<PUGIXML_CHAR, std::char_traits<PUGIXML_CHAR>, std::allocator<PUGIXML_CHAR> > string_t; typedef std::basic_string<PUGIXML_CHAR> string_t;
#endif #endif
} }
@ -353,14 +353,14 @@ namespace pugi
{ {
public: public:
// Construct writer from an output stream object // Construct writer from an output stream object
xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream); xml_writer_stream(std::basic_ostream<char>& stream);
xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream); xml_writer_stream(std::basic_ostream<wchar_t>& stream);
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE; virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
private: private:
std::basic_ostream<char, std::char_traits<char> >* narrow_stream; std::basic_ostream<char>* narrow_stream;
std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream; std::basic_ostream<wchar_t>* wide_stream;
}; };
#endif #endif
@ -700,8 +700,8 @@ namespace pugi
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
// Print subtree to stream // Print subtree to stream
void print(std::basic_ostream<char, std::char_traits<char> >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const; void print(std::basic_ostream<char>& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
void print(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const; void print(std::basic_ostream<wchar_t>& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const;
#endif #endif
// Child nodes iterators // Child nodes iterators
@ -1072,8 +1072,8 @@ namespace pugi
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
// Load document from stream. // Load document from stream.
xml_parse_result load(std::basic_istream<char, std::char_traits<char> >& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); xml_parse_result load(std::basic_istream<char>& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
xml_parse_result load(std::basic_istream<wchar_t, std::char_traits<wchar_t> >& stream, unsigned int options = parse_default); xml_parse_result load(std::basic_istream<wchar_t>& stream, unsigned int options = parse_default);
#endif #endif
// (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied. // (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied.
@ -1102,8 +1102,8 @@ namespace pugi
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
// Save XML document to stream (semantics is slightly different from xml_node::print, see documentation for details). // Save XML document to stream (semantics is slightly different from xml_node::print, see documentation for details).
void save(std::basic_ostream<char, std::char_traits<char> >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const; void save(std::basic_ostream<char>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
void save(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const; void save(std::basic_ostream<wchar_t>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const;
#endif #endif
// Save XML to file // Save XML to file
@ -1439,12 +1439,12 @@ namespace pugi
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
// Convert wide string to UTF8 // Convert wide string to UTF8
std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str); std::basic_string<char> PUGIXML_FUNCTION as_utf8(const wchar_t* str);
std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >& str); std::basic_string<char> PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t>& str);
// Convert UTF8 to wide string // Convert UTF8 to wide string
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str); std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const char* str);
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >& str); std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const std::basic_string<char>& str);
#endif #endif
// Memory allocation function interface; returns pointer to allocated memory or NULL on failure // Memory allocation function interface; returns pointer to allocated memory or NULL on failure
@ -1491,7 +1491,7 @@ namespace std
#endif #endif
/** /**
* Copyright (c) 2006-2023 Arseny Kapoulkine * Copyright (c) 2006-2024 Arseny Kapoulkine
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation

View File

@ -45,7 +45,7 @@ foreach ($vs in $args)
Add-AppveyorTest $target -Outcome Running Add-AppveyorTest $target -Outcome Running
Write-Output "# Building $target.exe" Write-Output "# Building $target.exe"
& cmd /c "cl.exe /Fe$target.exe /EHsc /W4 /WX $deflist $sources 2>&1" | Tee-Object -Variable buildOutput & cmd /c "cl.exe /MP /Fe$target.exe /EHsc /W4 /WX $deflist $sources 2>&1" | Tee-Object -Variable buildOutput
if ($?) if ($?)
{ {

View File

@ -1,26 +1,46 @@
#include "../src/pugixml.hpp" #include "../src/pugixml.hpp"
#include "fuzzer/FuzzedDataProvider.h"
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <string>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)
{ {
char* text = new char[Size + 1]; FuzzedDataProvider fdp(Data, Size);
memcpy(text, Data, Size); std::string text = fdp.ConsumeRandomLengthString(1024);
text[Size] = 0;
#ifdef PUGIXML_NO_EXCEPTIONS #ifndef PUGIXML_NO_EXCEPTIONS
pugi::xpath_query q(text);
#else
try try
#endif
{ {
pugi::xpath_query q(text); pugi::xpath_variable_set vars;
size_t var_count = fdp.ConsumeIntegralInRange<size_t>(0, 50);
std::vector<std::string> var_name_storage;
for (size_t i = 0; i < var_count; ++i)
{
var_name_storage.push_back(fdp.ConsumeRandomLengthString(128));
const int xpath_value_type_count = pugi::xpath_type_boolean + 1;
pugi::xpath_value_type value_type = static_cast<pugi::xpath_value_type>(fdp.ConsumeIntegralInRange(0, xpath_value_type_count));
vars.add(var_name_storage.back().c_str(), value_type);
}
pugi::xpath_query q(text.c_str(), &vars);
std::vector<uint8_t> xml_buffer = fdp.ConsumeBytes<uint8_t>(fdp.ConsumeIntegralInRange(0, 1024));
pugi::xml_document doc;
doc.load_buffer(xml_buffer.data(), xml_buffer.size(), pugi::parse_full);
q.evaluate_boolean(doc);
q.evaluate_number(doc);
q.evaluate_string(doc);
q.evaluate_node(doc);
q.evaluate_node_set(doc);
} }
#ifndef PUGIXML_NO_EXCEPTIONS
catch (pugi::xpath_exception&) catch (pugi::xpath_exception&)
{ {
} }
#endif #endif
delete[] text;
return 0; return 0;
} }

View File

@ -573,7 +573,8 @@ TEST_XML(xpath_api_nodeset_move_assign_self, "<node><foo/><foo/><bar/></node>")
test_runner::_memory_fail_threshold = 1; test_runner::_memory_fail_threshold = 1;
set = std::move(*&set); xpath_node_set* self = &set;
set = std::move(*self);
} }
TEST(xpath_api_query_move) TEST(xpath_api_query_move)
@ -614,7 +615,8 @@ TEST(xpath_api_query_move)
CHECK(q4); CHECK(q4);
CHECK(q4.evaluate_boolean(c)); CHECK(q4.evaluate_boolean(c));
q4 = std::move(*&q4); xpath_query* q4self = &q4;
q4 = std::move(*q4self);
CHECK(q4); CHECK(q4);
CHECK(q4.evaluate_boolean(c)); CHECK(q4.evaluate_boolean(c));