1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-19 16:47:14 +02:00

Major plugin refactor and cleanup.

Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
This commit is contained in:
Sandu Liviu Catalin
2021-01-30 08:51:39 +02:00
parent e0e34b4030
commit 4a6bfc086c
6219 changed files with 1209835 additions and 454916 deletions
CMakeLists.txt
cmake
module
Base
CMakeLists.txtCore.cppCore.hpp
Core
Entity
Library
Logger.cppLogger.hppMain.cpp
Misc
Register.cppSqBase.hpp
Sqrat
VCMP
Vendor
AES256
B64
CMakeLists.txt
CPR
CURL
CHANGES
CMake
CMakeLists.txtCOPYINGGIT-INFOMacOSX-FrameworkMakefile.amMakefile.distREADMEREADME.mdRELEASE-NOTESSECURITY.mdacinclude.m4appveyor.ymlbuildconfbuildconf.batconfigure.accurl-config.in
include
lib
CMakeLists.txtMakefile.amMakefile.incMakefile.m32Makefile.netwareMakefile.vxworksaltsvc.caltsvc.hamigaos.camigaos.harpa_telnet.hasyn-ares.casyn-thread.casyn.hbase64.cc-hyper.cc-hyper.hchecksrc.plconfig-amigaos.hconfig-dos.hconfig-mac.hconfig-os400.hconfig-plan9.hconfig-riscos.hconfig-tpf.hconfig-vxworks.hconfig-win32.hconfig-win32ce.hconncache.cconncache.hconnect.cconnect.hcontent_encoding.ccontent_encoding.hcookie.ccookie.hcurl_addrinfo.ccurl_addrinfo.hcurl_base64.hcurl_config.h.cmakecurl_ctype.ccurl_ctype.hcurl_des.ccurl_des.hcurl_endian.ccurl_endian.hcurl_fnmatch.ccurl_fnmatch.hcurl_get_line.ccurl_get_line.hcurl_gethostname.ccurl_gethostname.hcurl_gssapi.ccurl_gssapi.hcurl_hmac.hcurl_krb5.hcurl_ldap.hcurl_md4.hcurl_md5.hcurl_memory.hcurl_memrchr.ccurl_memrchr.hcurl_multibyte.ccurl_multibyte.hcurl_ntlm_core.ccurl_ntlm_core.hcurl_ntlm_wb.ccurl_ntlm_wb.hcurl_path.ccurl_path.hcurl_printf.hcurl_range.ccurl_range.hcurl_rtmp.ccurl_rtmp.hcurl_sasl.ccurl_sasl.hcurl_setup.hcurl_setup_once.hcurl_sha256.hcurl_sspi.ccurl_sspi.hcurl_threads.ccurl_threads.hcurlx.hdict.cdict.hdoh.cdoh.hdotdot.cdotdot.hdynbuf.cdynbuf.heasy.ceasygetopt.ceasyif.heasyoptions.ceasyoptions.hescape.cescape.hfile.cfile.hfileinfo.cfileinfo.hfirefox-db2pem.shformdata.cformdata.hftp.cftp.hftplistparser.cftplistparser.hgetenv.cgetinfo.cgetinfo.hgopher.cgopher.hhash.chash.hhmac.chostasyn.chostcheck.chostcheck.hhostip.chostip.hhostip4.chostip6.chostsyn.chsts.chsts.hhttp.chttp.hhttp2.chttp2.hhttp_aws_sigv4.chttp_aws_sigv4.hhttp_chunks.chttp_chunks.hhttp_digest.chttp_digest.hhttp_negotiate.chttp_negotiate.hhttp_ntlm.chttp_ntlm.hhttp_proxy.chttp_proxy.hidn_win32.cif2ip.cif2ip.himap.cimap.hinet_ntop.cinet_ntop.hinet_pton.cinet_pton.hkrb5.cldap.clibcurl.plistlibcurl.rclibcurl.vers.inllist.cllist.hmakefile.amigamakefile.djmd4.cmd5.cmemdebug.cmemdebug.hmime.cmime.hmk-ca-bundle.plmk-ca-bundle.vbsmprintf.cmqtt.cmqtt.hmulti.cmultihandle.hmultiif.hnetrc.cnetrc.hnon-ascii.cnon-ascii.hnonblock.cnonblock.hnwlib.cnwos.copenldap.coptiontable.plparsedate.cparsedate.hpingpong.cpingpong.hpop3.cpop3.hprogress.cprogress.hpsl.cpsl.hquic.hrand.crand.hrename.crename.hrtsp.crtsp.hselect.cselect.hsendf.csendf.hsetopt.csetopt.hsetup-os400.hsetup-vms.hsetup-win32.hsha256.cshare.cshare.hsigpipe.hslist.cslist.hsmb.csmb.hsmtp.csmtp.hsockaddr.hsocketpair.csocketpair.hsocks.csocks.hsocks_gssapi.csocks_sspi.cspeedcheck.cspeedcheck.hsplay.csplay.hstrcase.cstrcase.hstrdup.cstrdup.hstrerror.cstrerror.hstrtok.cstrtok.hstrtoofft.cstrtoofft.hsystem_win32.csystem_win32.htelnet.ctelnet.htftp.ctftp.htimeval.ctimeval.htransfer.ctransfer.hurl.curl.hurlapi-int.hurlapi.curldata.h
vauth
version.cversion_win32.cversion_win32.h
vquic
vssh
vtls
warnless.cwarnless.hwildcard.cwildcard.hx509asn1.cx509asn1.h
libcurl.pc.in
m4
maketgz
packages
plan9
scripts
src
winbuild
CivetWeb
ConcurrentQueue
Hash
MDBC
CMakeLists.txtCOPYING.LIBREADME
cmake
examples
include
libmariadb
mariadb_config
plugins
win-iconv
win
MaxmindDB
PUGIXML
SQLite
SimpleIni
SimpleSocket
TinyDir
Whirlpool
ZLib
CMakeLists.txtChangeLogFAQINDEXMakefileMakefile.inREADMEadler32.c
amiga
configure
contrib
README.contrib
ada
amd64
asm686
blast
delphi
dotzlib
gcc_gvmat64
infback9
inflate86
iostream
iostream2
iostream3
masmx64
masmx86
minizip
pascal
puff
testzlib
untgz
vstudio
crc32.c
doc
examples
gzclose.cgzlib.cgzread.cgzwrite.cmake_vms.com
msdos
nintendods
old
os400
qnx
test
treebuild.xmluncompr.c
watcom
win32
zconf.h.cmakeinzconf.h.inzconf.h.includedzlib.3zlib.3.pdfzlib.mapzlib.pc.cmakeinzlib.pc.inzlib2ansizutil.czutil.h
sdk
vendor
CMakeLists.txt
CPR
ConcurrentQueue
Fmt
POCO
ApacheConnector
CHANGELOGCMakeLists.txtCODE_OF_CONDUCT.mdCONTRIBUTING.mdCONTRIBUTORS
CppParser
CppUnit
Crypto
CMakeLists.txtCrypto.progenCrypto_VS90.slnCrypto_VS90.vcprojCrypto_vs140.slnCrypto_vs140.vcxprojCrypto_vs140.vcxproj.filtersCrypto_vs150.slnCrypto_vs150.vcxprojCrypto_vs150.vcxproj.filtersCrypto_vs160.slnCrypto_vs160.vcxprojCrypto_vs160.vcxproj.filtersMakefile
cmake
dependencies
include
samples
src
testsuite
Data
CMakeLists.txtData.progenData_VS90.slnData_VS90.vcprojData_vs140.slnData_vs140.vcxprojData_vs140.vcxproj.filtersData_vs150.slnData_vs150.vcxprojData_vs150.vcxproj.filtersData_vs160.slnData_vs160.vcxprojData_vs160.vcxproj.filtersMakefile
MySQL
ODBC
PostgreSQL
SQLite
cmake
dependencies
doc
include
samples
Binding
CMakeLists.txtMakefile
RecordSet
RowFormatter
Tuple
TypeHandler
WebNotifier
dependenciessamples.progensamples_vs140.slnsamples_vs150.slnsamples_vs160.slnsamples_vs90.sln
src
testsuite
Encodings
CMakeLists.txt
Compiler
Encodings.progenEncodings_vs140.slnEncodings_vs140.vcxprojEncodings_vs140.vcxproj.filtersEncodings_vs150.slnEncodings_vs150.vcxprojEncodings_vs150.vcxproj.filtersEncodings_vs160.slnEncodings_vs160.vcxprojEncodings_vs160.vcxproj.filtersEncodings_vs90.slnEncodings_vs90.vcprojMakefile
cmake
dependenciesgenerateEncodings.sh
include
samples
src
testsuite
Foundation
CMakeLists.txtFoundation_vs140.slnFoundation_vs140.vcxprojFoundation_vs140.vcxproj.filtersFoundation_vs150.slnFoundation_vs150.vcxprojFoundation_vs150.vcxproj.filtersFoundation_vs160.slnFoundation_vs160.vcxprojFoundation_vs160.vcxproj.filtersMakefile
cmake
extradirs
include
Poco
ASCIIEncoding.hAbstractCache.hAbstractDelegate.hAbstractEvent.hAbstractObserver.hAbstractPriorityDelegate.hAbstractStrategy.hAccessExpirationDecorator.hAccessExpireCache.hAccessExpireLRUCache.hAccessExpireStrategy.hActiveDispatcher.hActiveMethod.hActiveResult.hActiveRunnable.hActiveStarter.hActivity.hAlignment.hAny.hArchiveStrategy.hArray.hAscii.hAsyncChannel.hAtomicCounter.hAtomicFlag.hAutoPtr.hAutoReleasePool.hBase32Decoder.hBase32Encoder.hBase64Decoder.hBase64Encoder.hBasicEvent.hBinaryReader.hBinaryWriter.hBuffer.hBufferAllocator.hBufferedBidirectionalStreamBuf.hBufferedStreamBuf.hBugcheck.hByteOrder.hChannel.hChecksum.hClassLibrary.hClassLoader.hClock.hCondition.hConfig.hConfigurable.hConsoleChannel.hCountingStream.hDataURIStream.hDataURIStreamFactory.hDateTime.hDateTimeFormat.hDateTimeFormatter.hDateTimeParser.hDebugger.hDefaultStrategy.hDeflatingStream.hDelegate.hDigestEngine.hDigestStream.hDirectoryIterator.hDirectoryIteratorStrategy.hDirectoryIterator_UNIX.hDirectoryIterator_WIN32U.hDirectoryWatcher.h
Dynamic
DynamicAny.hDynamicAnyHolder.hDynamicFactory.hDynamicStruct.hEnvironment.hEnvironment_UNIX.hEnvironment_VX.hEnvironment_WIN32U.hEnvironment_WINCE.hError.hErrorHandler.hEvent.hEventArgs.hEventChannel.hEventLogChannel.hEvent_POSIX.hEvent_VX.hEvent_WIN32.hException.hExpirationDecorator.hExpire.hExpireCache.hExpireLRUCache.hExpireStrategy.hFIFOBuffer.hFIFOBufferStream.hFIFOEvent.hFIFOStrategy.hFPEnvironment.hFPEnvironment_C99.hFPEnvironment_DEC.hFPEnvironment_DUMMY.hFPEnvironment_QNX.hFPEnvironment_SUN.hFPEnvironment_WIN32.hFile.hFileChannel.hFileStream.hFileStreamFactory.hFileStream_POSIX.hFileStream_WIN32.hFile_UNIX.hFile_VX.hFile_WIN32U.hFile_WINCE.hFormat.hFormatter.hFormattingChannel.hFoundation.hFunctionDelegate.hFunctionPriorityDelegate.hGlob.hHMACEngine.hHash.hHashFunction.hHashMap.hHashSet.hHashStatistic.hHashTable.hHexBinaryDecoder.hHexBinaryEncoder.hInflatingStream.hInstantiator.hJSONString.hKeyValueArgs.hLRUCache.hLRUStrategy.hLatin1Encoding.hLatin2Encoding.hLatin9Encoding.hLineEndingConverter.hLinearHashTable.hListMap.hLocalDateTime.hLogFile.hLogFile_STD.hLogFile_WIN32U.hLogStream.hLogger.hLoggingFactory.hLoggingRegistry.hMD4Engine.hMD5Engine.hManifest.hMemoryPool.hMemoryStream.hMessage.hMetaObject.hMetaProgramming.hMutex.hMutex_POSIX.hMutex_VX.hMutex_WIN32.hMutex_WINCE.hNObserver.hNamedEvent.hNamedEvent_Android.hNamedEvent_UNIX.hNamedEvent_WIN32U.hNamedMutex.hNamedMutex_Android.hNamedMutex_UNIX.hNamedMutex_WIN32U.hNamedTuple.hNestedDiagnosticContext.hNotification.hNotificationCenter.hNotificationQueue.hNotificationStrategy.hNullChannel.hNullStream.hNullable.hNumberFormatter.hNumberParser.hNumericString.hObjectPool.hObserver.hOptional.hOrderedMap.hOrderedSet.hPBKDF2Engine.hPath.hPath_UNIX.hPath_WIN32U.hPath_WINCE.hPatternFormatter.hPipe.hPipeImpl.hPipeImpl_DUMMY.hPipeImpl_POSIX.hPipeImpl_WIN32.hPipeStream.hPlatform.hPlatform_POSIX.hPlatform_VX.hPlatform_WIN32.hPoco.hPriorityDelegate.hPriorityEvent.hPriorityExpire.hPriorityNotificationQueue.hPriorityStrategy.hProcess.hProcess_UNIX.hProcess_VX.hProcess_WIN32U.hProcess_WINCE.hPurgeStrategy.hRWLock.hRWLock_Android.hRWLock_POSIX.hRWLock_VX.hRWLock_WIN32.hRWLock_WINCE.hRandom.hRandomStream.hRecursiveDirectoryIterator.hRecursiveDirectoryIteratorImpl.hRefCountedObject.hRegularExpression.hRotateStrategy.hRunnable.hRunnableAdapter.hSHA1Engine.hSHA2Engine.hScopedLock.hScopedUnlock.hSemaphore.hSemaphore_POSIX.hSemaphore_VX.hSemaphore_WIN32.hSharedLibrary.hSharedLibrary_HPUX.hSharedLibrary_UNIX.hSharedLibrary_VX.hSharedLibrary_WIN32U.hSharedMemory.hSharedMemory_DUMMY.hSharedMemory_POSIX.hSharedMemory_WIN32.hSharedPtr.hSignalHandler.hSimpleFileChannel.hSimpleHashTable.hSingletonHolder.hSortedDirectoryIterator.hSplitterChannel.hStopwatch.hStrategyCollection.hStreamChannel.hStreamConverter.hStreamCopier.hStreamTokenizer.hStreamUtil.hString.hStringTokenizer.hSynchronizedObject.hSyslogChannel.hTask.hTaskManager.hTaskNotification.hTeeStream.hTemporaryFile.hTextBufferIterator.hTextConverter.hTextEncoding.hTextIterator.hThread.hThreadLocal.hThreadPool.hThreadTarget.hThread_POSIX.hThread_VX.hThread_WIN32.hThread_WINCE.hTimedNotificationQueue.hTimer.hTimespan.hTimestamp.hTimezone.hToken.hTuple.hTypeList.hTypes.hURI.hURIStreamFactory.hURIStreamOpener.hUTF16Encoding.hUTF32Encoding.hUTF8Encoding.hUTF8String.hUTFString.hUUID.hUUIDGenerator.hUnWindows.hUnbufferedStreamBuf.hUnicode.hUnicodeConverter.hUniqueAccessExpireCache.hUniqueAccessExpireLRUCache.hUniqueAccessExpireStrategy.hUniqueExpireCache.hUniqueExpireLRUCache.hUniqueExpireStrategy.hValidArgs.hVersion.hVoid.hWindows1250Encoding.hWindows1251Encoding.hWindows1252Encoding.hWindowsConsoleChannel.hordered_hash.hordered_map.hordered_set.hzconf.hzlib.h
samples
ActiveMethod
Activity
BinaryReaderWriter
CMakeLists.txt
DateTime
LineEndingConverter
LogRotation
Logger
Makefile
NotificationQueue
StringTokenizer
Timer
URI
base64decode
base64encode
deflate
dir
grep
hmacmd5
inflate
md5
samples.progensamples_vs140.slnsamples_vs150.slnsamples_vs160.slnsamples_vs90.sln
uuidgen
src
ASCIIEncoding.cppAbstractObserver.cppActiveDispatcher.cppArchiveStrategy.cppAscii.cppAsyncChannel.cppAtomicCounter.cppAtomicFlag.cppBase32Decoder.cppBase32Encoder.cppBase64Decoder.cppBase64Encoder.cppBinaryReader.cppBinaryWriter.cppBugcheck.cppByteOrder.cppChannel.cppChecksum.cppClock.cppCondition.cppConfigurable.cppConsoleChannel.cppCountingStream.cppDataURIStream.cppDataURIStreamFactory.cppDateTime.cppDateTimeFormat.cppDateTimeFormatter.cppDateTimeParser.cppDebugger.cppDeflatingStream.cppDigestEngine.cppDigestStream.cppDirectoryIterator.cppDirectoryIteratorStrategy.cppDirectoryIterator_UNIX.cppDirectoryIterator_WIN32U.cppDirectoryWatcher.cppEnvironment.cppEnvironment_UNIX.cppEnvironment_VX.cppEnvironment_WIN32U.cppEnvironment_WINCE.cppError.cppErrorHandler.cppEvent.cppEventArgs.cppEventChannel.cppEventLogChannel.cppEvent_POSIX.cppEvent_VX.cppEvent_WIN32.cppException.cppFIFOBufferStream.cppFPEnvironment.cppFPEnvironment_C99.cppFPEnvironment_DEC.cppFPEnvironment_DUMMY.cppFPEnvironment_QNX.cppFPEnvironment_SUN.cppFPEnvironment_WIN32.cppFile.cppFileChannel.cppFileStream.cppFileStreamFactory.cppFileStream_POSIX.cppFileStream_WIN32.cppFile_UNIX.cppFile_VX.cppFile_WIN32U.cppFile_WINCE.cppFormat.cppFormatter.cppFormattingChannel.cppGlob.cppHash.cppHashStatistic.cppHexBinaryDecoder.cppHexBinaryEncoder.cppInflatingStream.cppJSONString.cppLatin1Encoding.cppLatin2Encoding.cppLatin9Encoding.cppLineEndingConverter.cppLocalDateTime.cppLogFile.cppLogFile_STD.cppLogFile_WIN32U.cppLogStream.cppLogger.cppLoggingFactory.cppLoggingRegistry.cppMD4Engine.cppMD5Engine.cppMSG00001.binManifest.cppMemoryPool.cppMemoryStream.cppMessage.cppMutex.cppMutex_POSIX.cppMutex_VX.cppMutex_WIN32.cppMutex_WINCE.cppNamedEvent.cppNamedEvent_Android.cppNamedEvent_UNIX.cppNamedEvent_WIN32U.cppNamedMutex.cppNamedMutex_Android.cppNamedMutex_UNIX.cppNamedMutex_WIN32U.cppNestedDiagnosticContext.cppNotification.cppNotificationCenter.cppNotificationQueue.cppNullChannel.cppNullStream.cppNumberFormatter.cppNumberParser.cppNumericString.cppPath.cppPath_UNIX.cppPath_WIN32U.cppPath_WINCE.cppPatternFormatter.cppPipe.cppPipeImpl.cppPipeImpl_DUMMY.cppPipeImpl_POSIX.cppPipeImpl_WIN32.cppPipeStream.cppPriorityNotificationQueue.cppProcess.cppProcess_UNIX.cppProcess_VX.cppProcess_WIN32U.cppProcess_WINCE.cppPurgeStrategy.cppRWLock.cppRWLock_Android.cppRWLock_POSIX.cppRWLock_VX.cppRWLock_WIN32.cppRWLock_WINCE.cppRandom.cppRandomStream.cppRefCountedObject.cppRegularExpression.cppRotateStrategy.cppRunnable.cppSHA1Engine.cppSHA2Engine.cppSemaphore.cppSemaphore_POSIX.cppSemaphore_VX.cppSemaphore_WIN32.cppSharedLibrary.cppSharedLibrary_HPUX.cppSharedLibrary_UNIX.cppSharedLibrary_VX.cppSharedLibrary_WIN32U.cppSharedMemory.cppSharedMemory_DUMMY.cppSharedMemory_POSIX.cppSharedMemory_WIN32.cppSignalHandler.cppSimpleFileChannel.cppSortedDirectoryIterator.cppSplitterChannel.cppStopwatch.cppStreamChannel.cppStreamConverter.cppStreamCopier.cppStreamTokenizer.cppString.cppStringTokenizer.cppSynchronizedObject.cppSyslogChannel.cppTask.cppTaskManager.cppTaskNotification.cppTeeStream.cppTemporaryFile.cppTextBufferIterator.cppTextConverter.cppTextEncoding.cppTextIterator.cppThread.cppThreadLocal.cppThreadPool.cppThreadTarget.cppThread_POSIX.cppThread_VX.cppThread_WIN32.cppThread_WINCE.cppTimedNotificationQueue.cppTimer.cppTimespan.cppTimestamp.cppTimezone.cppTimezone_UNIX.cppTimezone_VX.cppTimezone_WIN32.cppTimezone_WINCE.cppToken.cppURI.cppURIStreamFactory.cppURIStreamOpener.cppUTF16Encoding.cppUTF32Encoding.cppUTF8Encoding.cppUTF8String.cppUUID.cppUUIDGenerator.cppUnicode.cppUnicodeConverter.cppVar.cppVarHolder.cppVarIterator.cppVoid.cppWindows1250Encoding.cppWindows1251Encoding.cppWindows1252Encoding.cppWindowsConsoleChannel.cppadler32.cbignum-dtoa.ccbignum-dtoa.hbignum.ccbignum.hcached-powers.cccached-powers.hcompress.ccrc32.ccrc32.hdeflate.cdeflate.hdiy-fp.ccdiy-fp.hdouble-conversion.ccdouble-conversion.hfast-dtoa.ccfast-dtoa.hfixed-dtoa.ccfixed-dtoa.hgzguts.hieee.hinfback.cinffast.cinffast.hinffixed.hinflate.cinflate.hinftrees.cinftrees.hpcre.hpcre_byte_order.cpcre_chartables.cpcre_compile.cpcre_config.cpcre_config.hpcre_dfa_exec.cpcre_exec.cpcre_fullinfo.cpcre_get.cpcre_globals.cpcre_internal.hpcre_jit_compile.cpcre_maketables.cpcre_newline.cpcre_ord2utf8.cpcre_refcount.cpcre_string_utils.cpcre_study.cpcre_tables.cpcre_ucd.cpcre_valid_utf8.cpcre_version.cpcre_xclass.cpocomsg.mcstrtod.ccstrtod.htrees.ctrees.hucp.hutils.hzconf.hzlib.hzutil.czutil.h
testsuite
CMakeLists.txtMakefileMakefile-DriverMakefile-TestAppMakefile-TestLibraryTestApp_vs140.vcxprojTestApp_vs140.vcxproj.filtersTestApp_vs150.vcxprojTestApp_vs150.vcxproj.filtersTestApp_vs160.vcxprojTestApp_vs160.vcxproj.filtersTestLibrary_vs140.vcxprojTestLibrary_vs140.vcxproj.filtersTestLibrary_vs150.vcxprojTestLibrary_vs150.vcxproj.filtersTestLibrary_vs160.vcxprojTestLibrary_vs160.vcxproj.filtersTestSuite_vs140.vcxprojTestSuite_vs140.vcxproj.filtersTestSuite_vs150.vcxprojTestSuite_vs150.vcxproj.filtersTestSuite_vs160.vcxprojTestSuite_vs160.vcxproj.filtersnonexistent.txt
src
ActiveDispatcherTest.cppActiveDispatcherTest.hActiveMethodTest.cppActiveMethodTest.hActivityTest.cppActivityTest.hAnyTest.cppAnyTest.hArrayTest.cppArrayTest.hAutoPtrTest.cppAutoPtrTest.hAutoReleasePoolTest.cppAutoReleasePoolTest.hBase32Test.cppBase32Test.hBase64Test.cppBase64Test.hBasicEventTest.cppBasicEventTest.hBinaryReaderWriterTest.cppBinaryReaderWriterTest.hByteOrderTest.cppByteOrderTest.hCacheTestSuite.cppCacheTestSuite.hChannelTest.cppChannelTest.hClassLoaderTest.cppClassLoaderTest.hClockTest.cppClockTest.hConditionTest.cppConditionTest.hCoreTest.cppCoreTest.hCoreTestSuite.cppCoreTestSuite.hCountingStreamTest.cppCountingStreamTest.hCryptTestSuite.cppCryptTestSuite.hDataURIStreamTest.cppDataURIStreamTest.hDateTimeFormatterTest.cppDateTimeFormatterTest.hDateTimeParserTest.cppDateTimeParserTest.hDateTimeTest.cppDateTimeTest.hDateTimeTestSuite.cppDateTimeTestSuite.hDigestStreamTest.cppDigestStreamTest.hDirectoryIteratorsTest.cppDirectoryIteratorsTest.hDirectoryWatcherTest.cppDirectoryWatcherTest.hDriver.cppDummyDelegate.cppDummyDelegate.hDynamicFactoryTest.cppDynamicFactoryTest.hDynamicTestSuite.cppDynamicTestSuite.hEventTestSuite.cppEventTestSuite.hExpireCacheTest.cppExpireCacheTest.hExpireLRUCacheTest.cppExpireLRUCacheTest.hFIFOBufferStreamTest.cppFIFOBufferStreamTest.hFIFOEventTest.cppFIFOEventTest.hFPETest.cppFPETest.hFileChannelTest.cppFileChannelTest.hFileStreamTest.cppFileStreamTest.hFileTest.cppFileTest.hFilesystemTestSuite.cppFilesystemTestSuite.hFormatTest.cppFormatTest.hFoundationTestSuite.cppFoundationTestSuite.hGlobTest.cppGlobTest.hHMACEngineTest.cppHMACEngineTest.hHashMapTest.cppHashMapTest.hHashSetTest.cppHashSetTest.hHashTableTest.cppHashTableTest.hHashingTestSuite.cppHashingTestSuite.hHexBinaryTest.cppHexBinaryTest.hLRUCacheTest.cppLRUCacheTest.hLineEndingConverterTest.cppLineEndingConverterTest.hLinearHashTableTest.cppLinearHashTableTest.hListMapTest.cppListMapTest.hLocalDateTimeTest.cppLocalDateTimeTest.hLogStreamTest.cppLogStreamTest.hLoggerTest.cppLoggerTest.hLoggingFactoryTest.cppLoggingFactoryTest.hLoggingRegistryTest.cppLoggingRegistryTest.hLoggingTestSuite.cppLoggingTestSuite.hMD4EngineTest.cppMD4EngineTest.hMD5EngineTest.cppMD5EngineTest.hManifestTest.cppManifestTest.hMemoryPoolTest.cppMemoryPoolTest.hMemoryStreamTest.cppMemoryStreamTest.hNDCTest.cppNDCTest.hNamedEventTest.cppNamedEventTest.hNamedMutexTest.cppNamedMutexTest.hNamedTuplesTest.cppNamedTuplesTest.hNotificationCenterTest.cppNotificationCenterTest.hNotificationQueueTest.cppNotificationQueueTest.hNotificationsTestSuite.cppNotificationsTestSuite.hNullStreamTest.cppNullStreamTest.hNumberFormatterTest.cppNumberFormatterTest.hNumberParserTest.cppNumberParserTest.hObjectPoolTest.cppObjectPoolTest.hOrderedContainersTest.cppOrderedContainersTest.hPBKDF2EngineTest.cppPBKDF2EngineTest.hPathTest.cppPathTest.hPatternFormatterTest.cppPatternFormatterTest.hPriorityEventTest.cppPriorityEventTest.hPriorityNotificationQueueTest.cppPriorityNotificationQueueTest.hProcessTest.cppProcessTest.hProcessesTestSuite.cppProcessesTestSuite.hRWLockTest.cppRWLockTest.hRandomStreamTest.cppRandomStreamTest.hRandomTest.cppRandomTest.hRegularExpressionTest.cppRegularExpressionTest.hSHA1EngineTest.cppSHA1EngineTest.hSHA2EngineTest.cppSHA2EngineTest.hSemaphoreTest.cppSemaphoreTest.hSharedLibraryTest.cppSharedLibraryTest.hSharedLibraryTestSuite.cppSharedLibraryTestSuite.hSharedMemoryTest.cppSharedMemoryTest.hSharedPtrTest.cppSharedPtrTest.hSimpleFileChannelTest.cppSimpleFileChannelTest.hSimpleHashTableTest.cppSimpleHashTableTest.hStopwatchTest.cppStopwatchTest.hStreamConverterTest.cppStreamConverterTest.hStreamCopierTest.cppStreamCopierTest.hStreamTokenizerTest.cppStreamTokenizerTest.hStreamsTestSuite.cppStreamsTestSuite.hStringTest.cppStringTest.hStringTokenizerTest.cppStringTokenizerTest.hTaskManagerTest.cppTaskManagerTest.hTaskTest.cppTaskTest.hTaskTestSuite.cppTaskTestSuite.hTeeStreamTest.cppTeeStreamTest.hTestApp.cppTestApp_WINCE.cppTestChannel.cppTestChannel.hTestLibrary.cppTestPlugin.cppTestPlugin.hTextBufferIteratorTest.cppTextBufferIteratorTest.hTextConverterTest.cppTextConverterTest.hTextEncodingTest.cppTextEncodingTest.hTextIteratorTest.cppTextIteratorTest.hTextTestSuite.cppTextTestSuite.hThreadLocalTest.cppThreadLocalTest.hThreadPoolTest.cppThreadPoolTest.hThreadTest.cppThreadTest.hThreadingTestSuite.cppThreadingTestSuite.hTimedNotificationQueueTest.cppTimedNotificationQueueTest.hTimerTest.cppTimerTest.hTimespanTest.cppTimespanTest.hTimestampTest.cppTimestampTest.hTimezoneTest.cppTimezoneTest.hTuplesTest.cppTuplesTest.hTypeListTest.cppTypeListTest.hURIStreamOpenerTest.cppURIStreamOpenerTest.hURITest.cppURITest.hURITestSuite.cppURITestSuite.hUTF8StringTest.cppUTF8StringTest.hUUIDGeneratorTest.cppUUIDGeneratorTest.hUUIDTest.cppUUIDTest.hUUIDTestSuite.cppUUIDTestSuite.hUnicodeConverterTest.cppUnicodeConverterTest.hUniqueExpireCacheTest.cppUniqueExpireCacheTest.hUniqueExpireLRUCacheTest.cppUniqueExpireLRUCacheTest.hVarTest.cppVarTest.hWinCEDriver.cppWinDriver.cppZLibTest.cppZLibTest.hordered_map_util.h
testlibrary.opt
wcelibcex-1.0
JSON
CMakeLists.txtJSON.progenJSON_vs140.slnJSON_vs140.vcxprojJSON_vs140.vcxproj.filtersJSON_vs150.slnJSON_vs150.vcxprojJSON_vs150.vcxproj.filtersJSON_vs160.slnJSON_vs160.vcxprojJSON_vs160.vcxproj.filtersJSON_vs90.slnJSON_vs90.vcprojMakefile
cmake
dependencies
include
samples
src
testsuite
CMakeLists.txtMakefileTestSuite.progenTestSuite_vs140.vcxprojTestSuite_vs140.vcxproj.filtersTestSuite_vs150.vcxprojTestSuite_vs150.vcxproj.filtersTestSuite_vs160.vcxprojTestSuite_vs160.vcxproj.filtersTestSuite_vs90.vcproj
data
invalid-unicode
encoded-surrogate-half
invalid-utf-8-after-backslash
invalid-utf-8-in-array
invalid-utf-8-in-bigger-int
invalid-utf-8-in-escape
invalid-utf-8-in-exponent
invalid-utf-8-in-identifier
invalid-utf-8-in-int
invalid-utf-8-in-real-after-e
invalid-utf-8-in-string
lone-invalid-utf-8
lone-utf-8-continuation-byte
not-in-unicode-range
overlong-3-byte-encoding
overlong-4-byte-encoding
overlong-ascii-encoding
restricted-utf-8
truncated-utf-8
invalid
apostrophe
ascii-unicode-identifier
brace-comma
bracket-comma
bracket-one-comma
double-closing-brace
double-closing-bracket
empty
escaped-null-byte-in-string
extra-comma-in-array
extra-comma-in-multiline-array
garbage-after-newline
garbage-at-the-end
integer-starting-with-zero
invalid-escape
invalid-identifier
invalid-negative-integer
invalid-negative-real
invalid-second-surrogate
lone-open-brace
lone-open-bracket
lone-second-surrogate
minus-sign-without-number
negative-integer-starting-with-zero
null-byte-in-string
null-byte-outside-string
null
object-apostrophes
object-garbage-at-end
object-in-unterminated-array
object-no-colon
object-no-value
object-unterminated-value
real-garbage-after-e
real-negative-overflow
real-positive-overflow
real-truncated-at-e
real-truncated-at-point
tab-character-in-string
too-big-negative-integer
too-big-positive-integer
truncated-unicode-surrogate
unicode-identifier
unterminated-array-and-object
unterminated-array
unterminated-empty-key
unterminated-key
unterminated-object-and-array
unterminated-string
valid
complex-array
complex-object
empty-array
empty-object-in-array
empty-object
empty-string
escaped-utf-control-char
false
negative-int
negative-one
negative-zero
null
one-byte-utf-8
real-capital-e-negative-exponent
real-capital-e-positive-exponent
real-capital-e
real-exponent
real-fraction-exponent
real-negative-exponent
real-positive-exponent
real-underflow
short-string
simple-ascii-string
simple-int-0
simple-int-1
simple-int-123
simple-object
simple-real
string-escapes
three-byte-utf-8
true
two-byte-utf-8
utf-8-string
utf-surrogate-four-byte-encoding
src
JWT
LICENSEMakefile
MongoDB
CMakeLists.txtMakefileMongoDB.progenMongoDB_vs140.slnMongoDB_vs140.vcxprojMongoDB_vs140.vcxproj.filtersMongoDB_vs150.slnMongoDB_vs150.vcxprojMongoDB_vs150.vcxproj.filtersMongoDB_vs160.slnMongoDB_vs160.vcxprojMongoDB_vs160.vcxproj.filtersMongoDB_vs90.slnMongoDB_vs90.vcproj
cmake
dependencies
include
samples
src
testsuite
NEWS
Net
CMakeLists.txtMakefileNet.progenNet_vs140.slnNet_vs140.vcxprojNet_vs140.vcxproj.filtersNet_vs150.slnNet_vs150.vcxprojNet_vs150.vcxproj.filtersNet_vs160.slnNet_vs160.vcxprojNet_vs160.vcxproj.filtersNet_vs90.slnNet_vs90.vcproj
cmake
dependencies
include
Poco
Net
AbstractHTTPRequestHandler.hDNS.hDatagramSocket.hDatagramSocketImpl.hDialogSocket.hEscapeHTMLStream.hFTPClientSession.hFTPStreamFactory.hFilePartSource.hHTMLForm.hHTTPAuthenticationParams.hHTTPBasicCredentials.hHTTPBasicStreamBuf.hHTTPBufferAllocator.hHTTPChunkedStream.hHTTPClientSession.hHTTPCookie.hHTTPCredentials.hHTTPDigestCredentials.hHTTPFixedLengthStream.hHTTPHeaderStream.hHTTPIOStream.hHTTPMessage.hHTTPNTLMCredentials.hHTTPRequest.hHTTPRequestHandler.hHTTPRequestHandlerFactory.hHTTPResponse.hHTTPServer.hHTTPServerConnection.hHTTPServerConnectionFactory.hHTTPServerParams.hHTTPServerRequest.hHTTPServerRequestImpl.hHTTPServerResponse.hHTTPServerResponseImpl.hHTTPServerSession.hHTTPSession.hHTTPSessionFactory.hHTTPSessionInstantiator.hHTTPStream.hHTTPStreamFactory.hHostEntry.hICMPClient.hICMPEventArgs.hICMPPacket.hICMPPacketImpl.hICMPSocket.hICMPSocketImpl.hICMPv4PacketImpl.hIPAddress.hIPAddressImpl.hMailMessage.hMailRecipient.hMailStream.hMediaType.hMessageHeader.hMultiSocketPoller.hMulticastSocket.hMultipartReader.hMultipartWriter.hNTLMCredentials.hNTPClient.hNTPEventArgs.hNTPPacket.hNameValueCollection.hNet.hNetException.hNetworkInterface.hNullPartHandler.hOAuth10Credentials.hOAuth20Credentials.hPOP3ClientSession.hParallelSocketAcceptor.hParallelSocketReactor.hPartHandler.hPartSource.hPartStore.hPollSet.hQuotedPrintableDecoder.hQuotedPrintableEncoder.hRawSocket.hRawSocketImpl.hRemoteSyslogChannel.hRemoteSyslogListener.hSMTPChannel.hSMTPClientSession.hSSPINTLMCredentials.hServerSocket.hServerSocketImpl.hSingleSocketPoller.hSocket.hSocketAcceptor.hSocketAddress.hSocketAddressImpl.hSocketConnector.hSocketDefs.hSocketImpl.hSocketNotification.hSocketNotifier.hSocketReactor.hSocketStream.hStreamSocket.hStreamSocketImpl.hStringPartSource.hTCPServer.hTCPServerConnection.hTCPServerConnectionFactory.hTCPServerDispatcher.hTCPServerParams.hUDPClient.hUDPHandler.hUDPServer.hUDPServerParams.hUDPSocketReader.hWebSocket.hWebSocketImpl.h
samples
CMakeLists.txt
EchoServer
HTTPFormServer
HTTPLoadTest
HTTPTimeServer
Mail
Makefile
Ping
SMTPLogger
TimeServer
WebSocketServer
dependencies
dict
download
httpget
ifconfig
samples.progensamples_vs140.slnsamples_vs150.slnsamples_vs160.slnsamples_vs90.sln
tcpserver
src
AbstractHTTPRequestHandler.cppDNS.cppDatagramSocket.cppDatagramSocketImpl.cppDialogSocket.cppEscapeHTMLStream.cppFTPClientSession.cppFTPStreamFactory.cppFilePartSource.cppHTMLForm.cppHTTPAuthenticationParams.cppHTTPBasicCredentials.cppHTTPBufferAllocator.cppHTTPChunkedStream.cppHTTPClientSession.cppHTTPCookie.cppHTTPCredentials.cppHTTPDigestCredentials.cppHTTPFixedLengthStream.cppHTTPHeaderStream.cppHTTPIOStream.cppHTTPMessage.cppHTTPNTLMCredentials.cppHTTPRequest.cppHTTPRequestHandler.cppHTTPRequestHandlerFactory.cppHTTPResponse.cppHTTPServer.cppHTTPServerConnection.cppHTTPServerConnectionFactory.cppHTTPServerParams.cppHTTPServerRequest.cppHTTPServerRequestImpl.cppHTTPServerResponse.cppHTTPServerResponseImpl.cppHTTPServerSession.cppHTTPSession.cppHTTPSessionFactory.cppHTTPSessionInstantiator.cppHTTPStream.cppHTTPStreamFactory.cppHostEntry.cppICMPClient.cppICMPEventArgs.cppICMPPacket.cppICMPPacketImpl.cppICMPSocket.cppICMPSocketImpl.cppICMPv4PacketImpl.cppIPAddress.cppIPAddressImpl.cppMailMessage.cppMailRecipient.cppMailStream.cppMediaType.cppMessageHeader.cppMulticastSocket.cppMultipartReader.cppMultipartWriter.cppNTLMCredentials.cppNTPClient.cppNTPEventArgs.cppNTPPacket.cppNameValueCollection.cppNet.cppNetException.cppNetworkInterface.cppNullPartHandler.cppOAuth10Credentials.cppOAuth20Credentials.cppPOP3ClientSession.cppPartHandler.cppPartSource.cppPartStore.cppPollSet.cppQuotedPrintableDecoder.cppQuotedPrintableEncoder.cppRawSocket.cppRawSocketImpl.cppRemoteSyslogChannel.cppRemoteSyslogListener.cppSMTPChannel.cppSMTPClientSession.cppSSPINTLMCredentials.cppServerSocket.cppServerSocketImpl.cppSocket.cppSocketAddress.cppSocketAddressImpl.cppSocketImpl.cppSocketNotification.cppSocketNotifier.cppSocketReactor.cppSocketStream.cppStreamSocket.cppStreamSocketImpl.cppStringPartSource.cppTCPServer.cppTCPServerConnection.cppTCPServerConnectionFactory.cppTCPServerDispatcher.cppTCPServerParams.cppUDPClient.cppUDPServerParams.cppWebSocket.cppWebSocketImpl.cpp
testsuite
CMakeLists.txtMakefileTestSuite.progenTestSuite_vs140.vcxprojTestSuite_vs140.vcxproj.filtersTestSuite_vs150.vcxprojTestSuite_vs150.vcxproj.filtersTestSuite_vs160.vcxprojTestSuite_vs160.vcxproj.filtersTestSuite_vs90.vcproj
src
DNSTest.cppDNSTest.hDatagramSocketTest.cppDatagramSocketTest.hDialogServer.cppDialogServer.hDialogSocketTest.cppDialogSocketTest.hDriver.cppEchoServer.cppEchoServer.hFTPClientSessionTest.cppFTPClientSessionTest.hFTPClientTestSuite.cppFTPClientTestSuite.hFTPStreamFactoryTest.cppFTPStreamFactoryTest.hHTMLFormTest.cppHTMLFormTest.hHTMLTestSuite.cppHTMLTestSuite.hHTTPClientSessionTest.cppHTTPClientSessionTest.hHTTPClientTestSuite.cppHTTPClientTestSuite.hHTTPCookieTest.cppHTTPCookieTest.hHTTPCredentialsTest.cppHTTPCredentialsTest.hHTTPRequestTest.cppHTTPRequestTest.hHTTPResponseTest.cppHTTPResponseTest.hHTTPServerTest.cppHTTPServerTest.hHTTPServerTestSuite.cppHTTPServerTestSuite.hHTTPStreamFactoryTest.cppHTTPStreamFactoryTest.hHTTPTestServer.cppHTTPTestServer.hHTTPTestSuite.cppHTTPTestSuite.hICMPClientTest.cppICMPClientTest.hICMPClientTestSuite.cppICMPClientTestSuite.hICMPSocketTest.cppICMPSocketTest.hIPAddressTest.cppIPAddressTest.hMailMessageTest.cppMailMessageTest.hMailStreamTest.cppMailStreamTest.hMailTestSuite.cppMailTestSuite.hMediaTypeTest.cppMediaTypeTest.hMessageHeaderTest.cppMessageHeaderTest.hMessagesTestSuite.cppMessagesTestSuite.hMulticastEchoServer.cppMulticastEchoServer.hMulticastSocketTest.cppMulticastSocketTest.hMultipartReaderTest.cppMultipartReaderTest.hMultipartWriterTest.cppMultipartWriterTest.hNTLMCredentialsTest.cppNTLMCredentialsTest.hNTPClientTest.cppNTPClientTest.hNTPClientTestSuite.cppNTPClientTestSuite.hNameValueCollectionTest.cppNameValueCollectionTest.hNetCoreTestSuite.cppNetCoreTestSuite.hNetTestSuite.cppNetTestSuite.hNetworkInterfaceTest.cppNetworkInterfaceTest.hOAuth10CredentialsTest.cppOAuth10CredentialsTest.hOAuth20CredentialsTest.cppOAuth20CredentialsTest.hOAuthTestSuite.cppOAuthTestSuite.hPOP3ClientSessionTest.cppPOP3ClientSessionTest.hPollSetTest.cppPollSetTest.hQuotedPrintableTest.cppQuotedPrintableTest.hRawSocketTest.cppRawSocketTest.hReactorTestSuite.cppReactorTestSuite.hSMTPClientSessionTest.cppSMTPClientSessionTest.hSocketAddressTest.cppSocketAddressTest.hSocketReactorTest.cppSocketReactorTest.hSocketStreamTest.cppSocketStreamTest.hSocketTest.cppSocketTest.hSocketsTestSuite.cppSocketsTestSuite.hSyslogTest.cppSyslogTest.hTCPServerTest.cppTCPServerTest.hTCPServerTestSuite.cppTCPServerTestSuite.hUDPEchoServer.cppUDPEchoServer.hUDPServerTest.cppUDPServerTest.hUDPServerTestSuite.cppUDPServerTestSuite.hWebSocketTest.cppWebSocketTest.hWebSocketTestSuite.cppWebSocketTestSuite.hWinCEDriver.cppWinDriver.cpp
NetSSL_OpenSSL
CMakeLists.txtMakefileNetSSL_OpenSSL.progenNetSSL_OpenSSL_vs140.slnNetSSL_OpenSSL_vs140.vcxprojNetSSL_OpenSSL_vs140.vcxproj.filtersNetSSL_OpenSSL_vs150.slnNetSSL_OpenSSL_vs150.vcxprojNetSSL_OpenSSL_vs150.vcxproj.filtersNetSSL_OpenSSL_vs160.slnNetSSL_OpenSSL_vs160.vcxprojNetSSL_OpenSSL_vs160.vcxproj.filtersNetSSL_OpenSSL_vs90.slnNetSSL_OpenSSL_vs90.vcproj
cmake
dependencies
doc
include
samples
src
testsuite
NetSSL_Win
CMakeLists.txtNetSSL_Win.progenNetSSL_Win_vs140.slnNetSSL_Win_vs140.vcxprojNetSSL_Win_vs140.vcxproj.filtersNetSSL_Win_vs150.slnNetSSL_Win_vs150.vcxprojNetSSL_Win_vs150.vcxproj.filtersNetSSL_Win_vs160.slnNetSSL_Win_vs160.vcxprojNetSSL_Win_vs160.vcxproj.filtersNetSSL_Win_vs90.slnNetSSL_Win_vs90.vcproj
cmake
doc
include
samples
src
testsuite
PDF
CMakeLists.txtMakefilePDF.progenPDF_vs140.slnPDF_vs140.vcxprojPDF_vs140.vcxproj.filtersPDF_vs150.slnPDF_vs150.vcxprojPDF_vs150.vcxproj.filtersPDF_vs160.slnPDF_vs160.vcxprojPDF_vs160.vcxproj.filtersPDF_vs90.slnPDF_vs90.vcproj
cmake
dependencies
include
samples
src
testsuite
PageCompiler
PocoDoc
ProGen
ProGen.progenProGen_vs140.slnProGen_vs140.vcxprojProGen_vs140.vcxproj.filtersProGen_vs150.slnProGen_vs150.vcxprojProGen_vs150.vcxproj.filtersProGen_vs160.slnProGen_vs160.vcxprojProGen_vs160.vcxproj.filtersProGen_vs90.slnProGen_vs90.vcprojprogen.batprogen.propertiesprogen32.batprogen64.batrebuildall32.batrebuildall64.bat
src
templates
vs140
vs150
vs160
READMEREADME.md
Redis
SevenZip
Util
CMakeLists.txtMakefileUtil.progenUtil_vs140.slnUtil_vs140.vcxprojUtil_vs140.vcxproj.filtersUtil_vs150.slnUtil_vs150.vcxprojUtil_vs150.vcxproj.filtersUtil_vs160.slnUtil_vs160.vcxprojUtil_vs160.vcxproj.filtersUtil_vs90.slnUtil_vs90.vcproj
cmake
dependencies
include
samples
src
testsuite
VERSION
XML
CMakeLists.txtMakefileXML.progenXML_vs140.slnXML_vs140.vcxprojXML_vs140.vcxproj.filtersXML_vs150.slnXML_vs150.vcxprojXML_vs150.vcxproj.filtersXML_vs160.slnXML_vs160.vcxprojXML_vs160.vcxproj.filtersXML_vs90.slnXML_vs90.vcproj
cmake
dependencies
include
samples
src
testsuite
Zip
CMakeLists.txtMakefileZip.progenZip_vs140.slnZip_vs140.vcxprojZip_vs140.vcxproj.filtersZip_vs150.slnZip_vs150.vcxprojZip_vs150.vcxproj.filtersZip_vs160.slnZip_vs160.vcxprojZip_vs160.vcxproj.filtersZip_vs90.slnZip_vs90.vcproj
cmake
dependencies
doc
include
samples
src
testsuite
appveyor.yml
appveyor
build
build_cmake.cmdbuild_cmake.shbuild_vs140.cmdbuild_vs150.cmdbuild_vs160.cmdbuildwin.cmdbuildwin.ps1
cmake
componentsconfigure
contrib
cppignore.lnxcppignore.win
doc
env.batenv.shlibversion
packaging
patches
release
travis
SimpleIni
Squirrel
TinyDir

@ -0,0 +1,78 @@
//
// AbstractContainerNode.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the AbstractContainerNode class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_AbstractContainerNode_INCLUDED
#define DOM_AbstractContainerNode_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractNode.h"
namespace Poco {
namespace XML {
class XML_API AbstractContainerNode: public AbstractNode
/// AbstractContainerNode is an implementation of Node
/// that stores and manages child nodes.
///
/// Child nodes are organized in a single linked list.
{
public:
// Node
Node* firstChild() const;
Node* lastChild() const;
Node* insertBefore(Node* newChild, Node* refChild);
Node* replaceChild(Node* newChild, Node* oldChild);
Node* removeChild(Node* oldChild);
Node* appendChild(Node* newChild);
bool hasChildNodes() const;
bool hasAttributes() const;
Node* getNodeByPath(const XMLString& path) const;
Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const;
protected:
AbstractContainerNode(Document* pOwnerDocument);
AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node);
~AbstractContainerNode();
void dispatchNodeRemovedFromDocument();
void dispatchNodeInsertedIntoDocument();
static const Node* findNode(XMLString::const_iterator& it, const XMLString::const_iterator& end, const Node* pNode, const NSMap* pNSMap);
static const Node* findElement(const XMLString& name, const Node* pNode, const NSMap* pNSMap);
static const Node* findElement(int index, const Node* pNode, const NSMap* pNSMap);
static const Node* findElement(const XMLString& attr, const XMLString& value, const Node* pNode, const NSMap* pNSMap);
static const Attr* findAttribute(const XMLString& name, const Node* pNode, const NSMap* pNSMap);
bool hasAttributeValue(const XMLString& name, const XMLString& value, const NSMap* pNSMap) const;
static bool namesAreEqual(const Node* pNode1, const Node* pNode2, const NSMap* pNSMap);
static bool namesAreEqual(const Node* pNode, const XMLString& name, const NSMap* pNSMap);
static const XMLString WILDCARD;
private:
AbstractNode* _pFirstChild;
friend class AbstractNode;
friend class NodeAppender;
};
} } // namespace Poco::XML
#endif // DOM_AbstractContainerNode_INCLUDED

@ -0,0 +1,125 @@
//
// AbstractNode.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the AbstractNode class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_AbstractNode_INCLUDED
#define DOM_AbstractNode_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/Node.h"
#include "Poco/DOM/MutationEvent.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class AbstractContainerNode;
class Attr;
class EventDispatcher;
class XML_API AbstractNode: public Node
/// AbstractNode provides a basic implementation
/// of the Node interface for all types of nodes
/// that do not contain other nodes.
{
public:
// Node
const XMLString& nodeName() const;
const XMLString& getNodeValue() const;
void setNodeValue(const XMLString& value);
Node* parentNode() const;
NodeList* childNodes() const;
Node* firstChild() const;
Node* lastChild() const;
Node* previousSibling() const;
Node* nextSibling() const;
NamedNodeMap* attributes() const;
Document* ownerDocument() const;
Node* insertBefore(Node* newChild, Node* refChild);
Node* replaceChild(Node* newChild, Node* oldChild);
Node* removeChild(Node* oldChild);
Node* appendChild(Node* newChild);
bool hasChildNodes() const;
Node* cloneNode(bool deep) const;
void normalize();
bool isSupported(const XMLString& feature, const XMLString& version) const;
const XMLString& namespaceURI() const;
XMLString prefix() const;
const XMLString& localName() const;
bool hasAttributes() const;
// EventTarget
void addEventListener(const XMLString& type, EventListener* listener, bool useCapture);
void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture);
bool dispatchEvent(Event* evt);
// Extensions
XMLString innerText() const;
Node* getNodeByPath(const XMLString& path) const;
Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const;
virtual void autoRelease();
protected:
AbstractNode(Document* pOwnerDocument);
AbstractNode(Document* pOwnerDocument, const AbstractNode& node);
~AbstractNode();
virtual Node* copyNode(bool deep, Document* pOwnerDocument) const = 0;
virtual bool events() const;
virtual bool eventsSuspended() const;
void captureEvent(Event* evt);
void bubbleEvent(Event* evt);
void dispatchSubtreeModified();
void dispatchNodeInserted();
void dispatchNodeRemoved();
virtual void dispatchNodeRemovedFromDocument();
virtual void dispatchNodeInsertedIntoDocument();
void dispatchAttrModified(Attr* pAttr, MutationEvent::AttrChangeType changeType, const XMLString& prevValue, const XMLString& newValue);
void dispatchCharacterDataModified(const XMLString& prevValue, const XMLString& newValue);
void setOwnerDocument(Document* pOwnerDocument);
static const XMLString EMPTY_STRING;
private:
AbstractNode();
AbstractContainerNode* _pParent;
AbstractNode* _pNext;
Document* _pOwner;
EventDispatcher* _pEventDispatcher;
static const XMLString NODE_NAME;
friend class AbstractContainerNode;
friend class Document;
friend class DocumentFragment;
friend class Element;
friend class Attr;
friend class CharacterData;
friend class DOMBuilder;
friend class NodeAppender;
};
} } // namespace Poco::XML
#endif // DOM_AbstractNode_INCLUDED

180
vendor/POCO/XML/include/Poco/DOM/Attr.h vendored Normal file

@ -0,0 +1,180 @@
//
// Attr.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Attr class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Attr_INCLUDED
#define DOM_Attr_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractNode.h"
#include "Poco/DOM/Element.h"
#include "Poco/XML/Name.h"
namespace Poco {
namespace XML {
class XML_API Attr: public AbstractNode
/// The Attr interface represents an attribute in an Element object. Typically
/// the allowable values for the attribute are defined in a document type definition.
///
/// Attr objects inherit the Node interface, but since they are not actually
/// child nodes of the element they describe, the DOM does not consider them
/// part of the document tree. Thus, the Node attributes parentNode, previousSibling,
/// and nextSibling have a null value for Attr objects. The DOM takes the view
/// that attributes are properties of elements rather than having a separate
/// identity from the elements they are associated with; this should make it
/// more efficient to implement such features as default attributes associated
/// with all elements of a given type. Furthermore, Attr nodes may not be immediate
/// children of a DocumentFragment. However, they can be associated with Element
/// nodes contained within a DocumentFragment. In short, users and implementors
/// of the DOM need to be aware that Attr nodes have some things in common with
/// other objects inheriting the Node interface, but they also are quite distinct.
///
/// The attribute's effective value is determined as follows: if this attribute
/// has been explicitly assigned any value, that value is the attribute's effective
/// value; otherwise, if there is a declaration for this attribute, and that
/// declaration includes a default value, then that default value is the attribute's
/// effective value; otherwise, the attribute does not exist on this element
/// in the structure model until it has been explicitly added. Note that the
/// nodeValue attribute on the Attr instance can also be used to retrieve the
/// string version of the attribute's value(s).
///
/// In XML, where the value of an attribute can contain entity references, the
/// child nodes of the Attr node provide a representation in which entity references
/// are not expanded. These child nodes may be either Text or EntityReference
/// nodes. Because the attribute type may be unknown, there are no tokenized
/// attribute values.
{
public:
const XMLString& name() const;
/// Returns the name of this attribute.
bool specified() const;
/// If this attribute was explicitly given a value in the original document,
/// this is true; otherwise, it is false. Note that the implementation is in
/// charge of this attribute, not the user. If the user changes the value of
/// the attribute (even if it ends up having the same value as the default value)
/// then the specified flag is automatically flipped to true. To re-specify
/// the attribute as the default value from the DTD, the user must delete the
/// attribute. The implementation will then make a new attribute available with
/// specified set to false and the default value (if one exists).
/// In summary:
///
/// * If the attribute has an assigned value in the document then specified
/// is true, and the value is the assigned value.
/// * If the attribute has no assigned value in the document and has a default
/// value in the DTD, then specified is false, and the value is the default
/// value in the DTD.
/// * If the attribute has no assigned value in the document and has a value
/// of #IMPLIED in the DTD, then the attribute does not appear in the structure
/// model of the document.
/// * If the attribute is not associated to any element (i.e. because it
/// was just created or was obtained from some removal or cloning operation)
/// specified is true.
const XMLString& value() const;
/// Returns the value of the attribute as a string. Character
/// and general entity references are replaced with their values. See also the
/// method getAttribute on the Element interface.
const XMLString& getValue() const;
/// Returns the value of the attribute as a string. Character
/// and general entity references are replaced with their values. See also the
/// method getAttribute on the Element interface.
void setValue(const XMLString& value);
/// Sets the value of the attribute as a string.
/// This creates a Text node with the unparsed contents of the string.
/// I.e. any characters that an XML processor would recognize as markup are
/// instead treated as literal text. See also the method setAttribute on the
/// Element interface.
// DOM Level 2
Element* ownerElement() const;
/// The Element node this attribute is attached to or null
/// if this attribute is not in use.
// Node
Node* parentNode() const;
const XMLString& nodeName() const;
const XMLString& getNodeValue() const;
void setNodeValue(const XMLString& value);
unsigned short nodeType() const;
Node* previousSibling() const;
const XMLString& namespaceURI() const;
XMLString prefix() const;
const XMLString& localName() const;
// Non-standard extensions
XMLString innerText() const;
protected:
Attr(Document* pOwnerDocument, Element* pOwnerElement, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& value, bool specified = true);
Attr(Document* pOwnerDocument, const Attr& attr);
~Attr();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
const Name& _name;
XMLString _value;
bool _specified;
friend class Document;
friend class Element;
friend class DOMBuilder;
};
//
// inlines
//
inline const XMLString& Attr::name() const
{
return _name.qname();
}
inline const XMLString& Attr::value() const
{
return _value;
}
inline const XMLString& Attr::getValue() const
{
return _value;
}
inline bool Attr::specified() const
{
return _specified;
}
inline Element* Attr::ownerElement() const
{
return static_cast<Element*>(_pParent);
}
} } // namespace Poco::XML
#endif // DOM_Attr_INCLUDED

@ -0,0 +1,65 @@
//
// AttrMap.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the AttrMap class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_AttrMap_INCLUDED
#define DOM_AttrMap_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/NamedNodeMap.h"
namespace Poco {
namespace XML {
class Element;
class XML_API AttrMap: public NamedNodeMap
// This implementation of NamedNodeMap is
// returned by Element::attributes()
{
public:
Node* getNamedItem(const XMLString& name) const;
Node* setNamedItem(Node* arg);
Node* removeNamedItem(const XMLString& name);
Node* item(unsigned long index) const;
unsigned long length() const;
Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const;
Node* setNamedItemNS(Node* arg);
Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName);
void autoRelease();
protected:
AttrMap(Element* pElement);
~AttrMap();
private:
AttrMap();
Element* _pElement;
friend class Element;
};
} } // namespace Poco::XML
#endif // DOM_AttrMap_INCLUDED

@ -0,0 +1,35 @@
//
// AutoPtr.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Import Poco::AutoPtr into the XML namespace.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMAutoPtr_INCLUDED
#define DOM_DOMAutoPtr_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/AutoPtr.h"
namespace Poco {
namespace XML {
using Poco::AutoPtr;
} } // namespace Poco::XML
#endif // DOM_DOMAutoPtr_INCLUDED

@ -0,0 +1,84 @@
//
// CDATASection.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM CDATASection class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_CDATASection_INCLUDED
#define DOM_CDATASection_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/Text.h"
namespace Poco {
namespace XML {
class XML_API CDATASection: public Text
/// CDATA sections are used to escape blocks of text containing characters that
/// would otherwise be regarded as markup. The only delimiter that is recognized
/// in a CDATA section is the "]]>" string that ends the CDATA section. CDATA
/// sections cannot be nested. Their primary purpose is for including material
/// such as XML fragments, without needing to escape all the delimiters.
///
/// The DOMString attribute of the Text node holds the text that is contained
/// by the CDATA section. Note that this may contain characters that need to
/// be escaped outside of CDATA sections and that, depending on the character
/// encoding ("charset") chosen for serialization, it may be impossible to write
/// out some characters as part of a CDATA section.
///
/// The CDATASection interface inherits from the CharacterData interface through
/// the Text interface. Adjacent CDATASection nodes are not merged by use of
/// the normalize method on the Element interface.
///
/// Note: Because no markup is recognized within a CDATASection, character numeric
/// references cannot be used as an escape mechanism when serializing. Therefore,
/// action needs to be taken when serializing a CDATASection with a character
/// encoding where some of the contained characters cannot be represented. Failure
/// to do so would not produce well-formed XML.
/// One potential solution in the serialization process is to end the CDATA
/// section before the character, output the character using a character reference
/// or entity reference, and open a new CDATA section for any further characters
/// in the text node. Note, however, that some code conversion libraries at
/// the time of writing do not return an error or exception when a character
/// is missing from the encoding, making the task of ensuring that data is not
/// corrupted on serialization more difficult.
{
public:
// Text
Text* splitText(unsigned long offset);
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
protected:
CDATASection(Document* pOwnerDocument, const XMLString& data);
CDATASection(Document* pOwnerDocument, const CDATASection& sec);
~CDATASection();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
static const XMLString NODE_NAME;
friend class Document;
};
} } // namespace Poco::XML
#endif // DOM_CDATASection_INCLUDED

@ -0,0 +1,123 @@
//
// CharacterData.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM CharacterData class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_CharacterData_INCLUDED
#define DOM_CharacterData_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractNode.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API CharacterData: public AbstractNode
/// The CharacterData interface extends Node with a set of attributes and methods
/// for accessing character data in the DOM. For clarity this set is defined
/// here rather than on each object that uses these attributes and methods.
/// No DOM objects correspond directly to CharacterData, though Text and others
/// do inherit the interface from it. All offsets in this interface start from 0.
///
/// Text strings in the DOM are represented in either UTF-8 (if XML_UNICODE_WCHAR_T is
/// not defined) or in UTF-16 (if XML_UNICODE_WCHAR_T is defined).
/// Indexing on character data is done in XMLChar units.
{
public:
const XMLString& data() const;
/// Returns the character data of the node that
/// implements the interface.
const XMLString& getData() const;
/// Returns the character data of the node that
/// implements the interface.
void setData(const XMLString& data);
/// Sets the character data of the node that
/// implements the interface.
unsigned long length() const;
/// Returns the number of XMLChars that are available
/// through getData and substringData. This may have the
/// value zero.
XMLString substringData(unsigned long offset, unsigned long count) const;
/// Extracts a range of data from the node.
/// If offset and count exceeds the length, then all
/// the characters to the end of the data are returned.
void appendData(const XMLString& arg);
/// Append the string to the end of the character data
/// of the node.
void insertData(unsigned long offset, const XMLString& arg);
/// Insert a string at the specified character offset.
void deleteData(unsigned long offset, unsigned long count);
/// Remove a range of characters from the node.
void replaceData(unsigned long offset, unsigned long count, const XMLString& arg);
/// Replace the characters starting at the specified character
/// offset with the specified string.
// Non-standard extensions
XMLString trimmedData() const;
/// Returns the character data of that node with
/// all surrounding whitespace removed.
///
/// This method is an extension to the W3C Document Object Model.
// Node
const XMLString& getNodeValue() const;
void setNodeValue(const XMLString& value);
protected:
CharacterData(Document* pOwnerDocument, const XMLString& data);
CharacterData(Document* pOwnerDocument, const CharacterData& data);
~CharacterData();
private:
XMLString _data;
};
//
// inlines
//
inline const XMLString& CharacterData::data() const
{
return _data;
}
inline const XMLString& CharacterData::getData() const
{
return _data;
}
inline unsigned long CharacterData::length() const
{
return (unsigned long) _data.length();
}
} } // namespace Poco::XML
#endif // DOM_CharacterData_INCLUDED

@ -0,0 +1,55 @@
//
// ChildNodesList.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the ChildNodesList class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_ChildNodesList_INCLUDED
#define DOM_ChildNodesList_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/NodeList.h"
namespace Poco {
namespace XML {
class XML_API ChildNodesList: public NodeList
// This implementation of NodeList is returned
// by Node::getChildNodes().
{
public:
Node* item(unsigned long index) const;
unsigned long length() const;
void autoRelease();
protected:
ChildNodesList(const Node* pParent);
~ChildNodesList();
private:
ChildNodesList();
const Node* _pParent;
friend class AbstractNode;
};
} } // namespace Poco::XML
#endif // DOM_ChildNodesList_INCLUDED

@ -0,0 +1,58 @@
//
// Comment.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Comment class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Comment_INCLUDED
#define DOM_Comment_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/CharacterData.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API Comment: public CharacterData
/// This interface inherits from CharacterData and represents the content of
/// a comment, i.e., all the characters between the starting '<!--' and ending
/// '-->'. Note that this is the definition of a comment in XML, and, in practice,
/// HTML, although some HTML tools may implement the full SGML comment structure.
{
public:
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
protected:
Comment(Document* pOwnerDocument, const XMLString& data);
Comment(Document* pOwnerDocument, const Comment& comment);
~Comment();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
static const XMLString NODE_NAME;
friend class Document;
};
} } // namespace Poco::XML
#endif // DOM_Comment_INCLUDED

@ -0,0 +1,112 @@
//
// DOMBuilder.h
//
// Library: XML
// Package: DOM
// Module: DOMBuilder
//
// Definition of the DOMBuilder class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMBuilder_INCLUDED
#define DOM_DOMBuilder_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/SAX/ContentHandler.h"
#include "Poco/SAX/LexicalHandler.h"
#include "Poco/SAX/DTDHandler.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XMLReader;
class Document;
class InputSource;
class AbstractNode;
class AbstractContainerNode;
class NamePool;
class XML_API DOMBuilder: protected DTDHandler, protected ContentHandler, protected LexicalHandler
/// This class builds a tree representation of an
/// XML document, according to the W3C Document Object Model, Level 1 and 2
/// specifications.
///
/// The actual XML parsing is done by an XMLReader, which
/// must be supplied to the DOMBuilder.
{
public:
DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = 0);
/// Creates a DOMBuilder using the given XMLReader.
/// If a NamePool is given, it becomes the Document's NamePool.
virtual ~DOMBuilder();
/// Destroys the DOMBuilder.
virtual Document* parse(const XMLString& uri);
/// Parse an XML document from a location identified by an URI.
virtual Document* parse(InputSource* pInputSource);
/// Parse an XML document from a location identified by an InputSource.
virtual Document* parseMemoryNP(const char* xml, std::size_t size);
/// Parses an XML document from memory.
protected:
// DTDHandler
void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
// ContentHandler
void setDocumentLocator(const Locator* loc);
void startDocument();
void endDocument();
void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes);
void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname);
void characters(const XMLChar ch[], int start, int length);
void ignorableWhitespace(const XMLChar ch[], int start, int length);
void processingInstruction(const XMLString& target, const XMLString& data);
void startPrefixMapping(const XMLString& prefix, const XMLString& uri);
void endPrefixMapping(const XMLString& prefix);
void skippedEntity(const XMLString& name);
// LexicalHandler
void startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId);
void endDTD();
void startEntity(const XMLString& name);
void endEntity(const XMLString& name);
void startCDATA();
void endCDATA();
void comment(const XMLChar ch[], int start, int length);
void appendNode(AbstractNode* pNode);
void setupParse();
private:
static const XMLString EMPTY_STRING;
XMLReader& _xmlReader;
NamePool* _pNamePool;
Document* _pDocument;
AbstractContainerNode* _pParent;
AbstractNode* _pPrevious;
bool _inCDATA;
bool _namespaces;
};
} } // namespace Poco::XML
#endif // DOM_DOMBuilder_INCLUDED

@ -0,0 +1,112 @@
//
// DOMException.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM DOMException class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMException_INCLUDED
#define DOM_DOMException_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLException.h"
namespace Poco {
namespace XML {
class XML_API DOMException: public XMLException
/// DOM operations only raise exceptions in "exceptional" circumstances, i.e.,
/// when an operation is impossible to perform (either for logical reasons,
/// because data is lost, or because the implementation has become unstable).
/// In general, DOM methods return specific error values in ordinary processing
/// situations, such as out-of-bound errors when using NodeList.
///
/// Implementations should raise other exceptions under other circumstances.
/// For example, implementations should raise an implementation-dependent exception
/// if a null argument is passed when null was not expected.
{
public:
enum
{
INDEX_SIZE_ERR = 1, /// index or size is negative or greater than allowed value
DOMSTRING_SIZE_ERR, /// the specified range of text does not fit into a DOMString (not used)
HIERARCHY_REQUEST_ERR, /// a node is inserted somewhere it doesn't belong
WRONG_DOCUMENT_ERR, /// a node is used in a different document than the one that created it
INVALID_CHARACTER_ERR, /// an invalid character is specified (not used)
NO_DATA_ALLOWED_ERR, /// data is specified for a node which does not support data
NO_MODIFICATION_ALLOWED_ERR, /// an attempt is made to modify an object where modifications are not allowed
NOT_FOUND_ERR, /// an attempt was made to reference a node in a context where it does not exist
NOT_SUPPORTED_ERR, /// the implementation does not support the type of object requested
INUSE_ATTRIBUTE_ERR, /// an attempt is made to add an attribute that is already in use elsewhere
INVALID_STATE_ERR, /// a parameter or an operation is not supported by the underlying object
SYNTAX_ERR, /// an invalid or illegal string is specified
INVALID_MODIFICATION_ERR, /// an attempt is made to modify the type of the underlying object
NAMESPACE_ERR, /// an attempt is made to create or change an object in a way which is incorrect with regard to namespaces
INVALID_ACCESS_ERR, /// an attempt is made to use an object that is not, or is no longer, usable
_NUMBER_OF_MESSAGES
};
DOMException(unsigned short code);
/// Creates a DOMException with the given error code.
DOMException(const DOMException& exc);
/// Creates a DOMException by copying another one.
~DOMException() noexcept;
/// Destroys the DOMException.
DOMException& operator = (const DOMException& exc);
const char* name() const noexcept;
/// Returns a static string describing the exception.
const char* className() const noexcept;
/// Returns the name of the exception class.
Poco::Exception* clone() const;
/// Creates an exact copy of the exception.
void rethrow() const;
/// (Re)Throws the exception.
unsigned short code() const;
/// Returns the DOM exception code.
protected:
static const std::string& message(unsigned short code);
private:
DOMException();
unsigned short _code;
static const std::string MESSAGES[_NUMBER_OF_MESSAGES];
};
//
// inlines
//
inline unsigned short DOMException::code() const
{
return _code;
}
} } // namespace Poco::XML
#endif // DOM_DOMException_INCLUDED

@ -0,0 +1,82 @@
//
// DOMImplementation.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM DOMImplementation class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMImplementation_INCLUDED
#define DOM_DOMImplementation_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class DocumentType;
class Document;
class NamePool;
class XML_API DOMImplementation
/// The DOMImplementation interface provides a number of methods for
/// performing operations that are independent of any particular instance
/// of the document object model.
/// In this implementation, DOMImplementation is implemented as a singleton.
{
public:
DOMImplementation();
/// Creates the DOMImplementation.
~DOMImplementation();
/// Destroys the DOMImplementation.
bool hasFeature(const XMLString& feature, const XMLString& version) const;
/// Tests if the DOM implementation implements a specific feature.
///
/// The only supported features are "XML", version "1.0" and "Core",
/// "Events", "MutationEvents" and "Traversal", version "2.0".
// DOM Level 2
DocumentType* createDocumentType(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const;
/// Creates an empty DocumentType node. Entity declarations and notations
/// are not made available. Entity reference expansions and default attribute
/// additions do not occur.
Document* createDocument(const XMLString& namespaceURI, const XMLString& qualifiedName, DocumentType* doctype) const;
/// Creates an XML Document object of the specified type with its document element.
///
/// Note: You can also create a Document directly using the new operator.
static const DOMImplementation& instance();
/// Returns a reference to the default DOMImplementation
/// object.
private:
static const XMLString FEATURE_XML;
static const XMLString FEATURE_CORE;
static const XMLString FEATURE_EVENTS;
static const XMLString FEATURE_MUTATIONEVENTS;
static const XMLString FEATURE_TRAVERSAL;
static const XMLString VERSION_1_0;
static const XMLString VERSION_2_0;
};
} } // namespace Poco::XML
#endif // DOM_DOMImplementation_INCLUDED

@ -0,0 +1,103 @@
//
// DOMObject.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOMObject class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMObject_INCLUDED
#define DOM_DOMObject_INCLUDED
#include "Poco/XML/XML.h"
namespace Poco {
namespace XML {
class XML_API DOMObject
/// The base class for all objects in the Document Object Model.
///
/// DOMObject defines the rules for memory management
/// in this implementation of the DOM. Violation of these
/// rules, which are outlined in the following, results
/// in memory leaks or dangling pointers.
///
/// Every object created by new or by a factory
/// method (for example, Document::create*) must be released
/// with a call to release() or autoRelease() when it
/// is no longer needed.
///
/// Every object created by cloning or importing another
/// object must be released.
/// For every call to duplicate() there must be a matching
/// call to release().
/// An object obtained via any other way must not be
/// released, except ownership of it has been explicitly
/// taken with a call to duplicate().
///
/// While DOMObjects are safe for use in multithreaded programs,
/// a DOMObject or one of its subclasses must not be accessed
/// from multiple threads simultaneously.
{
public:
DOMObject();
/// Creates the DOMObject.
/// The object's reference count is initialized to one.
void duplicate() const;
/// Increases the object's reference count.
void release() const;
/// Decreases the object's reference count.
/// If the reference count reaches zero,
/// the object is deleted.
virtual void autoRelease() = 0;
/// Adds the object to an appropriate
/// AutoReleasePool, which is usually the
/// AutoReleasePool managed by the Document
/// to which this object belongs.
protected:
virtual ~DOMObject();
/// Destroys the DOMObject.
private:
DOMObject(const DOMObject&);
DOMObject& operator = (const DOMObject&);
mutable int _rc;
};
//
// inlines
//
inline void DOMObject::duplicate() const
{
++_rc;
}
inline void DOMObject::release() const
{
if (--_rc == 0)
delete this;
}
} } // namespace Poco::XML
#endif // DOM_DOMObject_INCLUDED

@ -0,0 +1,114 @@
//
// DOMParser.h
//
// Library: XML
// Package: DOM
// Module: DOMParser
//
// Definition of the DOMParser class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMParser_INCLUDED
#define DOM_DOMParser_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/SAX/SAXParser.h"
namespace Poco {
namespace XML {
class NamePool;
class Document;
class InputSource;
class EntityResolver;
class XML_API DOMParser
/// This is a convenience class that combines a
/// DOMBuilder with a SAXParser, with the optional
/// support of a WhitespaceFilter.
{
public:
explicit DOMParser(NamePool* pNamePool = 0);
/// Creates a new DOMParser.
/// If a NamePool is given, it becomes the Document's NamePool.
explicit DOMParser(unsigned long namePoolSize);
/// Creates a new DOMParser, using the given NamePool size.
///
/// The given namePoolSize should be a suitable prime number,
/// e.g. 251, 509, 1021 or 4093, depending on the expected
/// size of the document.
~DOMParser();
/// Destroys the DOMParser.
void setEncoding(const XMLString& encoding);
/// Sets the encoding used by the parser if no
/// encoding is specified in the XML document.
const XMLString& getEncoding() const;
/// Returns the name of the encoding used by
/// the parser if no encoding is specified in
/// the XML document.
void addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding);
/// Adds an encoding to the parser.
void setFeature(const XMLString& name, bool state);
/// Set the state of a feature.
///
/// If a feature is not recognized by the DOMParser, it is
/// passed on to the underlying XMLReader.
///
/// The only currently supported feature is
/// http://www.appinf.com/features/no-whitespace-in-element-content
/// which, when activated, causes the WhitespaceFilter to
/// be used.
bool getFeature(const XMLString& name) const;
/// Look up the value of a feature.
///
/// If a feature is not recognized by the DOMParser, the
/// DOMParser queries the underlying SAXParser for the feature.
Document* parse(const XMLString& uri);
/// Parse an XML document from a location identified by an URI.
Document* parse(InputSource* pInputSource);
/// Parse an XML document from a location identified by an InputSource.
Document* parseString(const std::string& xml);
/// Parse an XML document from a string.
Document* parseMemory(const char* xml, std::size_t size);
/// Parse an XML document from memory.
EntityResolver* getEntityResolver() const;
/// Returns the entity resolver used by the underlying SAXParser.
void setEntityResolver(EntityResolver* pEntityResolver);
/// Sets the entity resolver on the underlying SAXParser.
static const XMLString FEATURE_FILTER_WHITESPACE;
private:
SAXParser _saxParser;
NamePool* _pNamePool;
bool _filterWhitespace;
};
} } // namespace Poco::XML
#endif // DOM_DOMParser_INCLUDED

@ -0,0 +1,122 @@
//
// DOMSerializer.h
//
// Library: XML
// Package: DOM
// Module: DOMSerializer
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMSerializer_INCLUDED
#define DOM_DOMSerializer_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/SAX/XMLReader.h"
namespace Poco {
namespace XML {
class Node;
class Element;
class Text;
class Comment;
class ProcessingInstruction;
class Entity;
class CDATASection;
class Notation;
class Document;
class DocumentType;
class DocumentFragment;
class DeclHandler;
class LexicalHandler;
class XML_API DOMSerializer: public XMLReader
/// The DOMSerializer serializes a DOM document
/// into a sequence of SAX events which are
/// reported to the registered SAX event
/// handlers.
///
/// The DOMWriter uses a DOMSerializer with an
/// XMLWriter to serialize a DOM document into
/// textual XML.
{
public:
DOMSerializer();
/// Creates the DOMSerializer.
~DOMSerializer();
/// Destroys the DOMSerializer.
void serialize(const Node* pNode);
/// Serializes a DOM node and its children
/// into a sequence of SAX events, which are
/// reported to the registered SAX event
/// handlers.
// XMLReader
void setEntityResolver(EntityResolver* pResolver);
EntityResolver* getEntityResolver() const;
void setDTDHandler(DTDHandler* pDTDHandler);
DTDHandler* getDTDHandler() const;
void setContentHandler(ContentHandler* pContentHandler);
ContentHandler* getContentHandler() const;
void setErrorHandler(ErrorHandler* pErrorHandler);
ErrorHandler* getErrorHandler() const;
void setFeature(const XMLString& featureId, bool state);
bool getFeature(const XMLString& featureId) const;
void setProperty(const XMLString& propertyId, const XMLString& value);
void setProperty(const XMLString& propertyId, void* value);
void* getProperty(const XMLString& propertyId) const;
protected:
void parse(InputSource* pSource);
/// The DOMSerializer cannot parse an InputSource,
/// so this method simply throws an XMLException when invoked.
void parse(const XMLString& systemId);
/// The DOMSerializer cannot parse from a system identifier,
/// so this method simply throws an XMLException when invoked.
void parseMemoryNP(const char* xml, std::size_t size);
/// The DOMSerializer cannot parse from a system identifier,
/// so this method simply throws an XMLException when invoked.
void iterate(const Node* pNode) const;
void handleNode(const Node* pNode) const;
void handleElement(const Element* pElement) const;
void handleCharacterData(const Text* pText) const;
void handleComment(const Comment* pComment) const;
void handlePI(const ProcessingInstruction* pPI) const;
void handleCDATASection(const CDATASection* pCDATA) const;
void handleDocument(const Document* pDocument) const;
void handleDocumentType(const DocumentType* pDocumentType) const;
void handleFragment(const DocumentFragment* pFragment) const;
void handleNotation(const Notation* pNotation) const;
void handleEntity(const Entity* pEntity) const;
private:
EntityResolver* _pEntityResolver;
DTDHandler* _pDTDHandler;
ContentHandler* _pContentHandler;
ErrorHandler* _pErrorHandler;
DeclHandler* _pDeclHandler;
LexicalHandler* _pLexicalHandler;
static const XMLString CDATA;
};
} } // namespace Poco::XML
#endif // DOM_DOMSerializer_INCLUDED

@ -0,0 +1,127 @@
//
// DOMWriter.h
//
// Library: XML
// Package: DOM
// Module: DOMWriter
//
// Definition of class DOMWriter.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DOMWriter_INCLUDED
#define DOM_DOMWriter_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
#include "Poco/XML/XMLStream.h"
#include "Poco/TextEncoding.h"
namespace Poco {
namespace XML {
class Node;
class Document;
class XML_API DOMWriter
/// The DOMWriter uses a DOMSerializer with an
/// XMLWriter to serialize a DOM document into
/// textual XML.
{
public:
DOMWriter();
/// Creates a DOMWriter.
~DOMWriter();
/// Destroys a DOMWriter.
void setEncoding(const std::string& encodingName, Poco::TextEncoding& textEncoding);
/// Sets the encoding, which will be reflected in the written XML declaration.
const std::string& getEncoding() const;
/// Returns the encoding name set with setEncoding.
void setOptions(int options);
/// Sets options for the internal XMLWriter.
///
/// See class XMLWriter for available options.
int getOptions() const;
/// Returns the options for the internal XMLWriter.
void setNewLine(const std::string& newLine);
/// Sets the line ending characters for the internal
/// XMLWriter. See XMLWriter::setNewLine() for a list
/// of supported values.
const std::string& getNewLine() const;
/// Returns the line ending characters used by the
/// internal XMLWriter.
void setIndent(const std::string& indent);
/// Sets the string used for one indentation step.
///
/// The default is a single TAB character.
/// The given string should only contain TAB or SPACE
/// characters (e.g., a single TAB character, or
/// two to four SPACE characters).
const std::string& getIndent() const;
/// Returns the string used for one indentation step.
void writeNode(XMLByteOutputStream& ostr, const Node* pNode);
/// Writes the XML for the given node to the specified stream.
void writeNode(const std::string& systemId, const Node* pNode);
/// Writes the XML for the given node to the file specified in systemId,
/// using a standard file output stream (Poco::FileOutputStream).
private:
std::string _encodingName;
Poco::TextEncoding* _pTextEncoding;
int _options;
std::string _newLine;
std::string _indent;
};
//
// inlines
//
inline const std::string& DOMWriter::getEncoding() const
{
return _encodingName;
}
inline int DOMWriter::getOptions() const
{
return _options;
}
inline const std::string& DOMWriter::getNewLine() const
{
return _newLine;
}
inline const std::string& DOMWriter::getIndent() const
{
return _indent;
}
} } // namespace Poco::XML
#endif // DOM_DOMWriter_INCLUDED

@ -0,0 +1,67 @@
//
// DTDMap.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DTDMap class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DTDMap_INCLUDED
#define DOM_DTDMap_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/NamedNodeMap.h"
namespace Poco {
namespace XML {
class DocumentType;
class XML_API DTDMap: public NamedNodeMap
/// This implementation of NamedNodeMap
/// is returned by DocumentType::entities()
/// and DocumentType::notations().
{
public:
Node* getNamedItem(const XMLString& name) const;
Node* setNamedItem(Node* arg);
Node* removeNamedItem(const XMLString& name);
Node* item(unsigned long index) const;
unsigned long length() const;
Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const;
Node* setNamedItemNS(Node* arg);
Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName);
void autoRelease();
protected:
DTDMap(const DocumentType* pDocumentType, unsigned short type);
~DTDMap();
private:
DTDMap();
const DocumentType* _pDocumentType;
unsigned short _type;
friend class DocumentType;
};
} } // namespace Poco::XML
#endif // DOM_DTDMap_INCLUDED

@ -0,0 +1,285 @@
//
// Document.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Document class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Document_INCLUDED
#define DOM_Document_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractContainerNode.h"
#include "Poco/DOM/DocumentEvent.h"
#include "Poco/DOM/Element.h"
#include "Poco/XML/XMLString.h"
#include "Poco/XML/NamePool.h"
#include "Poco/AutoReleasePool.h"
namespace Poco {
namespace XML {
class NamePool;
class DocumentType;
class DOMImplementation;
class DocumentFragment;
class Text;
class Comment;
class CDATASection;
class ProcessingInstruction;
class Attr;
class EntityReference;
class NodeList;
class Entity;
class Notation;
class XML_API Document: public AbstractContainerNode, public DocumentEvent
/// The Document interface represents the entire HTML or XML document. Conceptually,
/// it is the root of the document tree, and provides the primary access to the
/// document's data.
///
/// Since elements, text nodes, comments, processing instructions, etc. cannot exist
/// outside the context of a Document, the Document interface also contains the
/// factory methods needed to create these objects. The Node objects created have a
/// ownerDocument attribute which associates them with the Document within whose
/// context they were created.
{
public:
using AutoReleasePool = Poco::AutoReleasePool<DOMObject>;
explicit Document(NamePool* pNamePool = 0);
/// Creates a new document. If pNamePool == 0, the document
/// creates its own name pool, otherwise it uses the given name pool.
/// Sharing a name pool makes sense for documents containing instances
/// of the same schema, thus reducing memory usage.
explicit Document(unsigned long namePoolSize);
/// Creates a new document using a name pool with the given size, which
/// should be a prime number (e.g., 251, 509, 1021, 4093).
Document(DocumentType* pDocumentType, NamePool* pNamePool = 0);
/// Creates a new document. If pNamePool == 0, the document
/// creates its own name pool, otherwise it uses the given name pool.
/// Sharing a name pool makes sense for documents containing instances
/// of the same schema, thus reducing memory usage.
Document(DocumentType* pDocumentType, unsigned long namePoolSize);
/// Creates a new document using a name pool with the given size, which
/// should be a prime number (e.g., 251, 509, 1021, 4093).
NamePool& namePool();
/// Returns a pointer to the documents Name Pool.
AutoReleasePool& autoReleasePool();
/// Returns a pointer to the documents Auto Release Pool.
void collectGarbage();
/// Releases all objects in the Auto Release Pool.
void suspendEvents();
/// Suspends all events until resumeEvents() is called.
void resumeEvents();
/// Resumes all events suspended with suspendEvent();
bool eventsSuspended() const;
/// Returns true if events are suspended.
bool events() const;
/// Returns true if events are not suspended.
const DocumentType* doctype() const;
/// The Document Type Declaration (see DocumentType) associated with this document.
/// For HTML documents as well as XML documents without a document type declaration
/// this returns null. The DOM Level 1 does not support editing the Document
/// Type Declaration. docType cannot be altered in any way, including through
/// the use of methods inherited from the Node interface, such as insertNode
/// or removeNode.
const DOMImplementation& implementation() const;
/// The DOMImplementation object that handles this document. A DOM application
/// may use objects from multiple implementations.
Element* documentElement() const;
/// This is a convenience attribute that allows direct access to the child node
/// that is the root element of the document. For HTML documents, this is the
/// element with the tagName "HTML".
Element* createElement(const XMLString& tagName) const;
/// Creates an element of the type specified. Note that the instance returned
/// implements the Element interface, so attributes can be specified directly
/// on the returned object.
///
/// In addition, if there are known attributes with default values, Attr nodes
/// representing them are automatically created and attached to the element.
DocumentFragment* createDocumentFragment() const;
/// Creates an empty DocumentFragment object.
Text* createTextNode(const XMLString& data) const;
/// Creates a text node given the specified string.
Comment* createComment(const XMLString& data) const;
/// Creates a comment node given the specified string.
CDATASection* createCDATASection(const XMLString& data) const;
/// Creates a CDATASection node whose value is the specified string.
ProcessingInstruction* createProcessingInstruction(const XMLString& target, const XMLString& data) const;
/// Creates a ProcessingInstruction node given the specified target and data strings.
Attr* createAttribute(const XMLString& name) const;
/// Creates an Attr of the given name. Note that the Attr instance can then
/// be set on an Element using the setAttributeNode method.
EntityReference* createEntityReference(const XMLString& name) const;
/// Creates an EntityReference object. In addition, if the referenced entity
/// is known, the child list of the EntityReference node is made the same as
/// that of the corresponding Entity node.
NodeList* getElementsByTagName(const XMLString& name) const;
/// Returns a NodeList of all Elements with a given tag name in the order
/// in which they would be encountered in a preorder traversal of the
/// document tree.
///
/// The returned NodeList must be released with a call to release()
/// when no longer needed.
// DOM Level 2
Node* importNode(Node* importedNode, bool deep);
/// Imports a node from another document to this document. The returned node
/// has no parent; (parentNode is null). The source node is not altered or removed
/// from the original document; this method creates a new copy of the source
/// node.
/// For all nodes, importing a node creates a node object owned by the importing
/// document, with attribute values identical to the source node's nodeName
/// and nodeType, plus the attributes related to namespaces (prefix, localName,
/// and namespaceURI). As in the cloneNode operation on a Node, the source node
/// is not altered.
/// Additional information is copied as appropriate to the nodeType, attempting
/// to mirror the behavior expected if a fragment of XML or HTML source was
/// copied from one document to another, recognizing that the two documents
/// may have different DTDs in the XML case.
Element* createElementNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const;
/// Creates an element of the given qualified name and namespace URI.
Attr* createAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const;
/// Creates an attribute of the given qualified name and namespace URI.
NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns a NodeList of all the Elements with a given local name and
/// namespace URI in the order in which they are encountered in a
/// preorder traversal of the Document tree.
Element* getElementById(const XMLString& elementId) const;
/// Returns the Element whose ID is given by elementId. If no such
/// element exists, returns null. Behavior is not defined if more
/// than one element has this ID.
///
/// Note: The DOM implementation must have information that says
/// which attributes are of type ID. Attributes with the name "ID"
/// are not of type ID unless so defined. Implementations that do
/// not know whether attributes are of type ID or not are expected to
/// return null. This implementation therefore returns null.
///
/// See also the non-standard two argument variant of getElementById()
/// and getElementByIdNS().
// DocumentEvent
Event* createEvent(const XMLString& eventType) const;
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
// EventTarget
bool dispatchEvent(Event* evt);
// Extensions
Entity* createEntity(const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName) const;
/// Creates an Entity with the given name, publicId, systemId and notationName.
///
/// This method is not part of the W3C Document Object Model.
Notation* createNotation(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const;
/// Creates a Notation with the given name, publicId and systemId.
///
/// This method is not part of the W3C Document Object Model.
Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const;
/// Returns the first Element whose ID attribute (given in idAttribute)
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const;
/// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName)
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
protected:
~Document();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
DocumentType* getDoctype();
void setDoctype(DocumentType* pDoctype);
private:
DocumentType* _pDocumentType;
NamePool* _pNamePool;
AutoReleasePool _autoReleasePool;
int _eventSuspendLevel;
static const XMLString NODE_NAME;
friend class DOMBuilder;
};
//
// inlines
//
inline NamePool& Document::namePool()
{
return *_pNamePool;
}
inline Document::AutoReleasePool& Document::autoReleasePool()
{
return _autoReleasePool;
}
inline const DocumentType* Document::doctype() const
{
return _pDocumentType;
}
inline DocumentType* Document::getDoctype()
{
return _pDocumentType;
}
} } // namespace Poco::XML
#endif // DOM_Document_INCLUDED

@ -0,0 +1,65 @@
//
// DocumentEvent.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM DocumentEvent interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DocumentEvent_INCLUDED
#define DOM_DocumentEvent_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class Event;
class XML_API DocumentEvent
/// The DocumentEvent interface provides a mechanism by which the user can create
/// an Event of a type supported by the implementation. It is expected that
/// the DocumentEvent interface will be implemented on the same object which
/// implements the Document interface in an implementation which supports the
/// Event model.
{
public:
virtual Event* createEvent(const XMLString& eventType) const = 0;
/// Creates an event of the specified type.
///
/// The eventType parameter specifies the type of Event interface to be created.
/// If the Event interface specified is supported by the implementation this
/// method will return a new Event of the interface type requested. If the Event
/// is to be dispatched via the dispatchEvent method the appropriate event init
/// method must be called after creation in order to initialize the Event's
/// values. As an example, a user wishing to synthesize some kind of UIEvent
/// would call createEvent with the parameter "UIEvents". The initUIEvent method
/// could then be called on the newly created UIEvent to set the specific type
/// of UIEvent to be dispatched and set its context information.
/// The createEvent method is used in creating Events when it is either inconvenient
/// or unnecessary for the user to create an Event themselves. In cases where
/// the implementation provided Event is insufficient, users may supply their
/// own Event implementations for use with the dispatchEvent method.
protected:
virtual ~DocumentEvent();
};
} } // namespace Poco::XML
#endif // DOM_DocumentEvent_INCLUDED

@ -0,0 +1,84 @@
//
// DocumentFragment.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM DocumentFragment class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DocumentFragment_INCLUDED
#define DOM_DocumentFragment_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractContainerNode.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API DocumentFragment: public AbstractContainerNode
/// DocumentFragment is a "lightweight" or "minimal" Document object. It is
/// very common to want to be able to extract a portion of a document's tree
/// or to create a new fragment of a document. Imagine implementing a user command
/// like cut or rearranging a document by moving fragments around. It is desirable
/// to have an object which can hold such fragments and it is quite natural
/// to use a Node for this purpose. While it is true that a Document object
/// could fulfill this role, a Document object can potentially be a heavyweight
/// object, depending on the underlying implementation. What is really needed
/// for this is a very lightweight object. DocumentFragment is such an object.
///
/// Furthermore, various operations -- such as inserting nodes as children of
/// another Node -- may take DocumentFragment objects as arguments; this results
/// in all the child nodes of the DocumentFragment being moved to the child
/// list of this node.
///
/// The children of a DocumentFragment node are zero or more nodes representing
/// the tops of any sub-trees defining the structure of the document. DocumentFragment
/// nodes do not need to be well-formed XML documents (although they do need
/// to follow the rules imposed upon well-formed XML parsed entities, which
/// can have multiple top nodes). For example, a DocumentFragment might have
/// only one child and that child node could be a Text node. Such a structure
/// model represents neither an HTML document nor a well-formed XML document.
///
/// When a DocumentFragment is inserted into a Document (or indeed any other
/// Node that may take children) the children of the DocumentFragment and not
/// the DocumentFragment itself are inserted into the Node. This makes the DocumentFragment
/// very useful when the user wishes to create nodes that are siblings; the
/// DocumentFragment acts as the parent of these nodes so that the user can
/// use the standard methods from the Node interface, such as insertBefore and
/// appendChild.
{
public:
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
protected:
DocumentFragment(Document* pOwnerDocument);
DocumentFragment(Document* pOwnerDocument, const DocumentFragment& fragment);
~DocumentFragment();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
static const XMLString NODE_NAME;
friend class Document;
};
} } // namespace Poco::XML
#endif // DOM_DocumentFragment_INCLUDED

@ -0,0 +1,125 @@
//
// DocumentType.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM DocumentType class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_DocumentType_INCLUDED
#define DOM_DocumentType_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractContainerNode.h"
namespace Poco {
namespace XML {
class NamedNodeMap;
class XML_API DocumentType: public AbstractContainerNode
/// Each Document has a doctype attribute whose value is either null or a DocumentType
/// object. The DocumentType interface in the DOM Level 1 Core provides an
/// interface to the list of entities that are defined for the document, and
/// little else because the effect of namespaces and the various XML scheme
/// efforts on DTD representation are not clearly understood as of this writing.
///
/// The DOM Level 1 doesn't support editing DocumentType nodes.
{
public:
const XMLString& name() const;
/// The name of the DTD; i.e., the name immediately following the
/// DOCTYPE keyword.
NamedNodeMap* entities() const;
/// A NamedNodeMap containing the general entities,
/// both external and internal, declared in the DTD.
/// Duplicates are discarded.
///
/// Note: In this implementation, only the
/// external entities are reported.
/// Every node in this map also implements the
/// Entity interface.
///
/// The returned NamedNodeMap must be released with a call
/// to release() when no longer needed.
NamedNodeMap* notations() const;
/// A NamedNodeMap containing the notations declared in the DTD. Duplicates
/// are discarded. Every node in this map also implements the Notation interface.
/// The DOM Level 1 does not support editing notations, therefore notations
/// cannot be altered in any way.
///
/// The returned NamedNodeMap must be released with a call
/// to release() when no longer needed.
// DOM Level 2
const XMLString& publicId() const;
/// Returns the public identifier of the external DTD subset.
const XMLString& systemId() const;
/// Returns the system identifier of the external DTD subset.
const XMLString& internalSubset() const;
/// Returns the internal DTD subset. This implementation
/// returns an empty string.
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
protected:
DocumentType(Document* pOwner, const XMLString& name, const XMLString& publicId, const XMLString& systemId);
DocumentType(Document* pOwner, const DocumentType& dt);
~DocumentType();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
XMLString _name;
XMLString _publicId;
XMLString _systemId;
friend class DOMImplementation;
friend class Document;
friend class DOMBuilder;
};
//
// inlines
//
inline const XMLString& DocumentType::name() const
{
return _name;
}
inline const XMLString& DocumentType::publicId() const
{
return _publicId;
}
inline const XMLString& DocumentType::systemId() const
{
return _systemId;
}
} } // namespace Poco::XML
#endif // DOM_DocumentType_INCLUDED

@ -0,0 +1,219 @@
//
// Element.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Element class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Element_INCLUDED
#define DOM_Element_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractContainerNode.h"
#include "Poco/XML/Name.h"
namespace Poco {
namespace XML {
class Attr;
class NodeList;
class Document;
class XML_API Element: public AbstractContainerNode
/// The Element interface represents an element in an XML document.
/// Elements may have attributes associated with them; since the Element interface
/// inherits from Node, the generic Node interface attribute attributes may
/// be used to retrieve the set of all attributes for an element. There are
/// methods on the Element interface to retrieve either an Attr object by name
/// or an attribute value by name. In XML, where an attribute value may contain
/// entity references, an Attr object should be retrieved to examine the possibly
/// fairly complex sub-tree representing the attribute value.
{
public:
const XMLString& tagName() const;
/// Returns the name of the element.
///
/// For example, in
///
/// <elementExample id="demo">
/// ...
/// </elementExample>
///
/// tagName has the value "elementExample". Note that this is case-preserving in XML,
/// as are all of the operations of the DOM.
const XMLString& getAttribute(const XMLString& name) const;
/// Retrieves an attribute value by name.
///
/// Returns the attribute's value, if the attribute
/// exists, or an empty string otherwise.
void setAttribute(const XMLString& name, const XMLString& value);
/// Adds a new attribute. If an attribute with that name is already present
/// in the element, its value is changed to be that of the value parameter.
/// This value is a simple string; it is not parsed as it is being set. So any
/// markup (such as syntax to be recognized as an entity reference) is treated
/// as literal text, and needs to be appropriately escaped by the implementation
/// when it is written out.
void removeAttribute(const XMLString& name);
/// Removes an attribute by name.
Attr* getAttributeNode(const XMLString& name) const;
/// Retrieves an Attr node by name.
Attr* setAttributeNode(Attr* newAttr);
/// Adds a new attribute. If an attribute with that name is already
/// present in the element, it is replaced by the new one.
Attr* addAttributeNodeNP(Attr* oldAttr, Attr* newAttr);
/// For internal use only.
/// Adds a new attribute after oldAttr.
/// If oldAttr is 0, newAttr is set as first attribute.
/// Returns newAttr.
/// Does not fire any events.
Attr* removeAttributeNode(Attr* oldAttr);
/// Removes the specified attribute.
NodeList* getElementsByTagName(const XMLString& name) const;
/// Returns a NodeList of all descendant elements with a given tag
/// name, in the order in which they would be encountered in a
/// preorder traversal of the Element tree.
///
/// The special name "*" matches all tags.
///
/// The returned NodeList must be released with a call
/// to release() when no longer needed.
void normalize();
/// Puts all Text nodes in the full depth of the sub-tree underneath this Element,
/// including attribute nodes, into a "normal" form where only markup (e.g.,
/// tags, comments, processing instructions, CDATA sections, and entity references)
/// separates Text nodes, i.e., there are no adjacent Text nodes. This can be
/// used to ensure that the DOM view of a document is the same as if it were
/// saved and re-loaded, and is useful when operations (such as XPointer
/// lookups) that depend on a particular document tree structure are to be used.
///
/// Note: In cases where the document contains CDATASections, the normalize
/// operation alone may not be sufficient, since XPointers do not differentiate
/// between Text nodes and CDATASection nodes.
// DOM Level 2
const XMLString& getAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Retrieves an attribute value by name.
///
/// Returns the attribute's value, if the attribute
/// exists, or an empty string otherwise.
void setAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName, const XMLString& value);
/// Adds a new attribute. If an attribute with that name
/// is already present in the element, its value is changed
/// to be that of the value parameter.
void removeAttributeNS(const XMLString& namespaceURI, const XMLString& localName);
/// Removes an attribute by name.
Attr* getAttributeNodeNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Retrieves an Attr node by name.
Attr* setAttributeNodeNS(Attr* newAttr);
/// Adds a new attribute. If an attribute with that name is already
/// present in the element, it is replaced by the new one.
bool hasAttribute(const XMLString& name) const;
/// Returns true if and only if the element has the specified attribute.
bool hasAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns true if and only if the element has the specified attribute.
NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns a NodeList of all the descendant Elements with a given local name and namespace URI
/// in the order in which they are encountered in a preorder traversal of this Element tree.
///
/// The special value "*" matches all namespaces, or local names respectively.
///
/// The returned NodeList must be released with a call
/// to release() when no longer needed.
const XMLString& namespaceURI() const;
XMLString prefix() const;
const XMLString& localName() const;
bool hasAttributes() const;
XMLString innerText() const;
Element* getChildElement(const XMLString& name) const;
/// Returns the first child element with the given name, or null
/// if such an element does not exist.
///
/// This method is an extension to the W3C Document Object Model.
Element* getChildElementNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns the first child element with the given namespaceURI and localName,
/// or null if such an element does not exist.
///
/// This method is an extension to the W3C Document Object Model.
Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const;
/// Returns the first Element whose ID attribute (given in idAttribute)
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const;
/// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName)
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
// Node
const XMLString& nodeName() const;
NamedNodeMap* attributes() const;
unsigned short nodeType() const;
protected:
Element(Document* pOwnerDocument, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
Element(Document* pOwnerDocument, const Element& elem);
~Element();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
void dispatchNodeRemovedFromDocument();
void dispatchNodeInsertedIntoDocument();
private:
const Name& _name;
Attr* _pFirstAttr;
friend class Attr;
friend class Document;
friend class AttrMap;
};
//
// inlines
//
inline const XMLString& Element::tagName() const
{
return _name.qname();
}
} } // namespace Poco::XML
#endif // DOM_Element_INCLUDED

@ -0,0 +1,86 @@
//
// ElementsByTagNameList.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the ElementsByTagNameList and ElementsByTagNameListNS classes.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_ElementsByTagNameList_INCLUDED
#define DOM_ElementsByTagNameList_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/NodeList.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API ElementsByTagNameList: public NodeList
// This implementation of NodeList is returned
// by Document::getElementsByTagName() and
// Element::getElementsByTagName().
{
public:
Node* item(unsigned long index) const;
unsigned long length() const;
void autoRelease();
protected:
ElementsByTagNameList(const Node* pParent, const XMLString& name);
~ElementsByTagNameList();
Node* find(const Node* pParent, unsigned long index) const;
const Node* _pParent;
XMLString _name;
mutable unsigned long _count;
friend class AbstractContainerNode;
friend class Element;
friend class Document;
};
class XML_API ElementsByTagNameListNS: public NodeList
// This implementation of NodeList is returned
// by Document::getElementsByTagNameNS() and
// Element::getElementsByTagNameNS().
{
public:
virtual Node* item(unsigned long index) const;
virtual unsigned long length() const;
virtual void autoRelease();
protected:
ElementsByTagNameListNS(const Node* pParent, const XMLString& namespaceURI, const XMLString& localName);
~ElementsByTagNameListNS();
Node* find(const Node* pParent, unsigned long index) const;
const Node* _pParent;
XMLString _localName;
XMLString _namespaceURI;
mutable unsigned long _count;
friend class AbstractContainerNode;
friend class Element;
friend class Document;
};
} } // namespace Poco::XML
#endif // DOM_ElementsByTagNameList_INCLUDED

@ -0,0 +1,126 @@
//
// Entity.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Entity class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Entity_INCLUDED
#define DOM_Entity_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractContainerNode.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API Entity: public AbstractContainerNode
/// This interface represents an entity, either parsed or unparsed, in an XML
/// document. Note that this models the entity itself not the entity declaration.
/// Entity declaration modeling has been left for a later Level of the DOM
/// specification.
///
/// The nodeName attribute that is inherited from Node contains the name of
/// the entity.
///
/// An XML processor may choose to completely expand entities before the structure
/// model is passed to the DOM; in this case there will be no EntityReference
/// nodes in the document tree.
///
/// XML does not mandate that a non-validating XML processor read and process
/// entity declarations made in the external subset or declared in external
/// parameter entities. This means that parsed entities declared in the external
/// subset need not be expanded by some classes of applications, and that the
/// replacement value of the entity may not be available. When the replacement
/// value is available, the corresponding Entity node's child list represents
/// the structure of that replacement text. Otherwise, the child list is empty.
///
/// The resolution of the children of the Entity (the replacement value) may
/// be lazily evaluated; actions by the user (such as calling the childNodes
/// method on the Entity Node) are assumed to trigger the evaluation.
///
/// The DOM Level 1 does not support editing Entity nodes; if a user wants to
/// make changes to the contents of an Entity, every related EntityReference
/// node has to be replaced in the structure model by a clone of the Entity's
/// contents, and then the desired changes must be made to each of those clones
/// instead. Entity nodes and all their descendants are readonly.
///
/// An Entity node does not have any parent.
{
public:
const XMLString& publicId() const;
/// Returns the public identifier associated with
/// the entity, if specified. If the public identifier
/// was not specified, this is the empty string.
const XMLString& systemId() const;
/// Returns the system identifier associated with
/// the entity, if specified. If the system identifier
/// was not specified, this is the empty string.
const XMLString& notationName() const;
/// Returns, for unparsed entities, the name of the
/// notation for the entity. For parsed entities, this
/// is the empty string.
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
protected:
Entity(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName);
Entity(Document* pOwnerDocument, const Entity& entity);
~Entity();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
static const XMLString NODE_NAME;
XMLString _name;
XMLString _publicId;
XMLString _systemId;
XMLString _notationName;
friend class Document;
};
//
// inlines
//
inline const XMLString& Entity::publicId() const
{
return _publicId;
}
inline const XMLString& Entity::systemId() const
{
return _systemId;
}
inline const XMLString& Entity::notationName() const
{
return _notationName;
}
} } // namespace Poco::XML
#endif // DOM_Entity_INCLUDED

@ -0,0 +1,73 @@
//
// EntityReference.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM EntityReference class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_EntityReference_INCLUDED
#define DOM_EntityReference_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractNode.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API EntityReference: public AbstractNode
/// EntityReference objects may be inserted into the structure model when an
/// entity reference is in the source document, or when the user wishes to insert
/// an entity reference. Note that character references and references to predefined
/// entities are considered to be expanded by the HTML or XML processor so that
/// characters are represented by their Unicode equivalent rather than by an
/// entity reference. Moreover, the XML processor may completely expand references
/// to entities while building the structure model, instead of providing EntityReference
/// objects. If it does provide such objects, then for a given EntityReference
/// node, it may be that there is no Entity node representing the referenced
/// entity. If such an Entity exists, then the child list of the EntityReference
/// node is the same as that of the Entity node.
///
/// As for Entity nodes, EntityReference nodes and all their descendants are
/// readonly.
///
/// The resolution of the children of the EntityReference (the replacement value
/// of the referenced Entity) may be lazily evaluated; actions by the user (such
/// as calling the childNodes method on the EntityReference node) are assumed
/// to trigger the evaluation.
{
public:
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
protected:
EntityReference(Document* pOwnerDocument, const XMLString& name);
EntityReference(Document* pOwnerDocument, const EntityReference& ref);
~EntityReference();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
XMLString _name;
friend class Document;
};
} } // namespace Poco::XML
#endif // DOM_EntityReference_INCLUDED

209
vendor/POCO/XML/include/Poco/DOM/Event.h vendored Normal file

@ -0,0 +1,209 @@
//
// Event.h
//
// Library: XML
// Package: DOM
// Module: DOMEvents
//
// Definition of the DOM Event class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Event_INCLUDED
#define DOM_Event_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
#include "Poco/DOM/DOMObject.h"
namespace Poco {
namespace XML {
class EventTarget;
class Document;
class XML_API Event: public DOMObject
/// The Event interface is used to provide contextual information about an event
/// to the handler processing the event. An object which implements the Event
/// interface is generally passed as the first parameter to an event handler.
/// More specific context information is passed to event handlers by deriving
/// additional interfaces from Event which contain information directly relating
/// to the type of event they accompany. These derived interfaces are also implemented
/// by the object passed to the event listener.
{
public:
enum PhaseType
{
CAPTURING_PHASE = 1, /// The event is currently being evaluated at the target EventTarget.
AT_TARGET = 2, /// The current event phase is the bubbling phase.
BUBBLING_PHASE = 3 /// The current event phase is the capturing phase.
};
const XMLString& type() const;
/// The name of the event (case-insensitive). The name must be an XML name.
EventTarget* target() const;
/// Used to indicate the EventTarget to which the event was originally dispatched.
EventTarget* currentTarget() const;
/// Used to indicate the EventTarget whose EventListeners are currently being
/// processed. This is particularly useful during capturing and bubbling.
PhaseType eventPhase() const;
/// Used to indicate which phase of event flow is currently being evaluated.
bool bubbles() const;
/// Used to indicate whether or not an event is a bubbling event.
/// If the event can bubble the value is true, else the value is false.
bool cancelable() const;
/// Used to indicate whether or not an event can have its default action
/// prevented. If the default action can be prevented the value is
/// true, else the value is false.
Poco::UInt64 timeStamp() const;
/// Used to specify the time (in milliseconds relative to the epoch) at
/// which the event was created. Due to the fact that some
/// systems may not provide this information the value of timeStamp may
/// be not available for all events. When not available, a
/// value of 0 will be returned. Examples of epoch time are the time of the
/// system start or 0:0:0 UTC 1st January 1970.
/// This implementation always returns 0.
void stopPropagation();
/// The stopPropagation method is used prevent further propagation of an
/// event during event flow. If this method is called by
/// any EventListener the event will cease propagating through the tree.
/// The event will complete dispatch to all listeners on the
/// current EventTarget before event flow stops. This method may be used
/// during any stage of event flow.
void preventDefault();
/// If an event is cancelable, the preventDefault method is used to signify
/// that the event is to be canceled, meaning any default
/// action normally taken by the implementation as a result of
/// the event will not occur. If, during any stage of event flow, the
/// preventDefault method is called the event is canceled. Any default
/// action associated with the event will not occur. Calling
/// this method for a non-cancelable event has no effect. Once
/// preventDefault has been called it will remain in effect throughout
/// the remainder of the event's propagation. This method may be
/// used during any stage of event flow.
void initEvent(const XMLString& eventType, bool canBubble, bool isCancelable);
/// The initEvent method is used to initialize the value of an
/// Event created through the DocumentEvent interface. This method
/// may only be called before the Event has been dispatched via the
/// dispatchEvent method, though it may be called multiple
/// times during that phase if necessary. If called multiple
/// times the final invocation takes precedence. If called from
/// a subclass of Event interface only the values specified in the
/// initEvent method are modified, all other attributes are left unchanged.
void autoRelease();
protected:
Event(Document* pOwnerDocument, const XMLString& type);
Event(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool isCancelable);
~Event();
bool isCanceled() const;
/// returns true if and only if the event has been cancelled.
bool isStopped() const;
/// returns true if and only if propagation of the event has been stopped.
void setTarget(EventTarget* pTarget);
/// sets the target
void setCurrentPhase(PhaseType phase);
/// sets the current phase
void setCurrentTarget(EventTarget* pTarget);
/// sets the current target
private:
Document* _pOwner;
XMLString _type;
EventTarget* _pTarget;
EventTarget* _pCurrentTarget;
PhaseType _currentPhase;
bool _bubbles;
bool _cancelable;
bool _canceled;
bool _stopped;
friend class AbstractNode;
};
//
// inlines
//
inline const XMLString& Event::type() const
{
return _type;
}
inline EventTarget* Event::target() const
{
return _pTarget;
}
inline EventTarget* Event::currentTarget() const
{
return _pCurrentTarget;
}
inline Event::PhaseType Event::eventPhase() const
{
return _currentPhase;
}
inline bool Event::bubbles() const
{
return _bubbles;
}
inline bool Event::cancelable() const
{
return _cancelable;
}
inline Poco::UInt64 Event::timeStamp() const
{
return 0;
}
inline bool Event::isCanceled() const
{
return _canceled;
}
inline bool Event::isStopped() const
{
return _stopped;
}
} } // namespace Poco::XML
#endif // DOM_Event_INCLUDED

@ -0,0 +1,97 @@
//
// EventDispatcher.h
//
// Library: XML
// Package: DOM
// Module: DOMEvents
//
// Definition of the EventDispatcher class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_EventDispatcher_INCLUDED
#define DOM_EventDispatcher_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
#include <list>
namespace Poco {
namespace XML {
class Event;
class EventListener;
class XML_API EventDispatcher
/// This helper class manages event listener subscriptions
/// and event dispatching for AbstractNode.
///
/// The EventListener list is managed in such a way that
/// event listeners can be added and removed even
/// from within an EventListener, while events are being
/// dispatched.
{
public:
EventDispatcher();
/// Creates the EventDispatcher.
~EventDispatcher();
/// Destroys the EventDispatcher.
void addEventListener(const XMLString& type, EventListener* listener, bool useCapture);
/// Adds an EventListener to the internal list.
void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture);
/// Removes an EventListener from the internal list.
///
/// If a dispatch is currently in progress, the list
/// entry is only marked for deletion.
/// If no dispatch is currently in progress, all EventListeners
/// marked for deletion are removed from the list.
void dispatchEvent(Event* evt);
/// Dispatches the event.
///
/// Also removes all EventListeners marked for deletion from the
/// event dispatcher list.
void captureEvent(Event* evt);
/// Dispatches the event in its capturing phase.
///
/// Also removes all EventListeners marked for deletion from the
/// event dispatcher list.
void bubbleEvent(Event* evt);
/// Dispatches the event in its bubbling phase.
///
/// Also removes all EventListeners marked for deletion from the
/// event dispatcher list.
private:
struct EventListenerItem
{
XMLString type;
EventListener* pListener;
bool useCapture;
};
typedef std::list<EventListenerItem> EventListenerList;
int _inDispatch;
EventListenerList _listeners;
};
} } // namespace Poco::XML
#endif // DOM_EventDispatcher_INCLUDED

@ -0,0 +1,81 @@
//
// EventException.h
//
// Library: XML
// Package: DOM
// Module: DOMEvents
//
// Definition of the DOM EventException class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_EventException_INCLUDED
#define DOM_EventException_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLException.h"
namespace Poco {
namespace XML {
class XML_API EventException: public XMLException
/// Event operations may throw an EventException as
/// specified in their method descriptions.
{
public:
enum
{
UNSPECIFIED_EVENT_TYPE_ERR = 0 /// If the Event's type was not specified by initializing the
/// event before the method was called. Specification of the Event's
/// type as null or an empty string will also trigger this exception.
};
EventException(int code);
/// Creates an EventException with the given error code.
EventException(const EventException& exc);
/// Creates an EventException by copying another one.
~EventException() noexcept;
/// Destroys the EventException.
EventException& operator = (const EventException& exc);
const char* name() const noexcept;
/// Returns a static string describing the exception.
const char* className() const noexcept;
/// Returns the name of the exception class.
unsigned short code() const;
/// Returns the Event exception code.
protected:
Poco::Exception* clone() const;
private:
EventException();
};
//
// inlines
//
inline unsigned short EventException::code() const
{
return UNSPECIFIED_EVENT_TYPE_ERR;
}
} } // namespace Poco::XML
#endif // DOM_EventException_INCLUDED

@ -0,0 +1,57 @@
//
// EventListener.h
//
// Library: XML
// Package: DOM
// Module: DOMEvents
//
// Definition of the DOM EventListener interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_EventListener_INCLUDED
#define DOM_EventListener_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class Event;
class XML_API EventListener
/// The EventListener interface is the primary method for handling events. Users
/// implement the EventListener interface and register their listener on an
/// EventTarget using the AddEventListener method. The users should also remove
/// their EventListener from its EventTarget after they have completed using
/// the listener.
///
/// When a Node is copied using the cloneNode method the EventListeners attached
/// to the source Node are not attached to the copied Node. If the user wishes
/// the same EventListeners to be added to the newly created copy the user must
/// add them manually.
{
public:
virtual void handleEvent(Event* evt) = 0;
/// This method is called whenever an event occurs of the
/// type for which the EventListener interface was registered.
protected:
virtual ~EventListener();
};
} } // namespace Poco::XML
#endif // DOM_EventListener_INCLUDED

@ -0,0 +1,76 @@
//
// EventTarget.h
//
// Library: XML
// Package: DOM
// Module: DOMEvents
//
// Definition of the DOM EventTarget interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_EventTarget_INCLUDED
#define DOM_EventTarget_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/DOMObject.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class EventListener;
class Event;
class XML_API EventTarget: public DOMObject
/// The EventTarget interface is implemented by all Nodes in an implementation
/// which supports the DOM Event Model. Therefore, this interface can be obtained
/// by using binding-specific casting methods on an instance of the Node interface.
/// The interface allows registration and removal of EventListeners on an EventTarget
/// and dispatch of events to that EventTarget.
{
public:
virtual void addEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0;
/// This method allows the registration of event listeners on
/// the event target. If an EventListener is added to an
/// EventTarget while it is processing an event, it will not
/// be triggered by the current actions but may be triggered
/// during a later stage of event flow, such as the bubbling phase.
/// If multiple identical EventListeners are registered on the same
/// EventTarget with the same parameters the duplicate instances are
/// discarded. They do not cause the EventListener to be called twice and since they are
/// discarded they do not need to be removed with the removeEventListener method.
virtual void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0;
/// This method allows the removal of event listeners from the event
/// target. If an EventListener is removed from an EventTarget while it is
/// processing an event, it will not be triggered by the current actions.
/// EventListeners can never be invoked after being removed.
/// Calling removeEventListener with arguments which do not identify
/// any currently registered EventListener on the EventTarget has no effect.
virtual bool dispatchEvent(Event* evt) = 0;
/// This method allows the dispatch of events into the implementations
/// event model. Events dispatched in this manner will have the same capturing and
/// bubbling behavior as events dispatched directly by the
/// implementation. The target of the event is the EventTarget on
/// which dispatchEvent is called.
protected:
virtual ~EventTarget();
};
} } // namespace Poco::XML
#endif // DOM_EventTarget_INCLUDED

@ -0,0 +1,143 @@
//
// MutationEvent.h
//
// Library: XML
// Package: DOM
// Module: DOMEvents
//
// Definition of the DOM MutationEvent class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_MutationEvent_INCLUDED
#define DOM_MutationEvent_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/Event.h"
namespace Poco {
namespace XML {
class Node;
class XML_API MutationEvent: public Event
/// The MutationEvent interface provides specific contextual
/// information associated with Mutation events.
{
public:
enum AttrChangeType
{
MODIFICATION = 1, /// The Attr was modified in place.
ADDITION = 2, /// The Attr was just added.
REMOVAL = 3 /// The Attr was just removed.
};
Node* relatedNode() const;
/// relatedNode is used to identify a secondary node related to a mutation
/// event. For example, if a mutation event is dispatched
/// to a node indicating that its parent has changed, the relatedNode is the
/// changed parent. If an event is instead dispatched to a
/// subtree indicating a node was changed within it, the relatedNode is
/// the changed node. In the case of the DOMAttrModified
/// event it indicates the Attr node which was modified, added, or removed.
const XMLString& prevValue() const;
/// prevValue indicates the previous value of the Attr node in DOMAttrModified
/// events, and of the CharacterData node in DOMCharDataModified events.
const XMLString& newValue() const;
/// newValue indicates the new value of the Attr node in DOMAttrModified
/// events, and of the CharacterData node in DOMCharDataModified events.
const XMLString& attrName() const;
/// attrName indicates the name of the changed Attr node in a DOMAttrModified event.
AttrChangeType attrChange() const;
/// attrChange indicates the type of change which triggered the
/// DOMAttrModified event. The values can be MODIFICATION,
/// ADDITION, or REMOVAL.
void initMutationEvent(const XMLString& type, bool canBubble, bool cancelable, Node* relatedNode,
const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change);
/// The initMutationEvent method is used to initialize the value of a
/// MutationEvent created through the DocumentEvent
/// interface. This method may only be called before the MutationEvent
/// has been dispatched via the dispatchEvent method,
/// though it may be called multiple times during that phase if
/// necessary. If called multiple times, the final invocation takes
/// precedence.
// Event Types
static const XMLString DOMSubtreeModified;
static const XMLString DOMNodeInserted;
static const XMLString DOMNodeRemoved;
static const XMLString DOMNodeRemovedFromDocument;
static const XMLString DOMNodeInsertedIntoDocument;
static const XMLString DOMAttrModified;
static const XMLString DOMCharacterDataModified;
protected:
MutationEvent(Document* pOwnerDocument, const XMLString& type);
MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode);
MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode,
const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change);
~MutationEvent();
private:
XMLString _prevValue;
XMLString _newValue;
XMLString _attrName;
AttrChangeType _change;
Node* _pRelatedNode;
friend class AbstractNode;
friend class Document;
};
//
// inlines
//
inline Node* MutationEvent::relatedNode() const
{
return _pRelatedNode;
}
inline const XMLString& MutationEvent::prevValue() const
{
return _prevValue;
}
inline const XMLString& MutationEvent::newValue() const
{
return _newValue;
}
inline const XMLString& MutationEvent::attrName() const
{
return _attrName;
}
inline MutationEvent::AttrChangeType MutationEvent::attrChange() const
{
return _change;
}
} } // namespace Poco::XML
#endif // DOM_MutationEvent_INCLUDED

@ -0,0 +1,93 @@
//
// NamedNodeMap.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM NamedNodeMap interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_NamedNodeMap_INCLUDED
#define DOM_NamedNodeMap_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/DOMObject.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class Node;
class XML_API NamedNodeMap: public DOMObject
/// Objects implementing the NamedNodeMap interface are used to represent collections
/// of nodes that can be accessed by name. Note that NamedNodeMap does not inherit
/// from NodeList; NamedNodeMaps are not maintained in any particular order.
/// Objects contained in an object implementing NamedNodeMap may also be accessed
/// by an ordinal index, but this is simply to allow convenient enumeration
/// of the contents of a NamedNodeMap, and does not imply that the DOM specifies
/// an order to these Nodes.
///
/// NamedNodeMap objects in the DOM are live.
///
/// A NamedNodeMap returned from a method must be released with a call to
/// release() when no longer needed.
{
public:
virtual Node* getNamedItem(const XMLString& name) const = 0;
/// Retrieves a node specified by name.
virtual Node* setNamedItem(Node* arg) = 0;
/// Adds a node using its nodeName attribute. If a node with that name is already
/// present in this map, it is replaced by the new one.
/// As the nodeName attribute is used to derive the name which the node must
/// be stored under, multiple nodes of certain types (those that have a "special"
/// string value) cannot be stored as the names would clash. This is seen as
/// preferable to allowing nodes to be aliased.
virtual Node* removeNamedItem(const XMLString& name) = 0;
/// Removes a node specified by name. When this map contains the attributes
/// attached to an element, if the removed attribute is known to have a default
/// value, an attribute immediately appears containing the default value.
virtual Node* item(unsigned long index) const = 0;
/// Returns the index'th item in the map. If index is greater
/// than or equal to the number of nodes in the map, this
/// returns null.
virtual unsigned long length() const = 0;
/// Returns the number of nodes in the map. The range of valid
/// child node indices is 0 to length - 1 inclusive.
// DOM Level 2
virtual Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const = 0;
/// Retrieves a node specified by name.
virtual Node* setNamedItemNS(Node* arg) = 0;
/// Adds a node using its nodeName attribute.
/// If a node with that namespace URI and that local name is already
/// present in this map, it is replaced by the new one.
virtual Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) = 0;
/// Removes a node specified by name.
protected:
virtual ~NamedNodeMap();
};
} } // namespace Poco::XML
#endif // DOM_NamedNodeMap_INCLUDED

285
vendor/POCO/XML/include/Poco/DOM/Node.h vendored Normal file

@ -0,0 +1,285 @@
//
// Node.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Node interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Node_INCLUDED
#define DOM_Node_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/EventTarget.h"
#include "Poco/XML/XMLString.h"
#include "Poco/SAX/NamespaceSupport.h"
namespace Poco {
namespace XML {
class NamedNodeMap;
class Document;
class NodeList;
class XML_API Node: public EventTarget
/// The Node interface is the primary datatype for the entire Document Object
/// Model. It represents a single node in the document tree. While all objects
/// implementing the Node interface expose methods for dealing with children,
/// not all objects implementing the Node interface may have children. For
/// example, Text nodes may not have children, and adding children to such
/// nodes results in a DOMException being raised.
///
/// The attributes nodeName, nodeValue and attributes are included as a mechanism
/// to get at node information without casting down to the specific derived
/// interface. In cases where there is no obvious mapping of these attributes
/// for a specific nodeType (e.g., nodeValue for an Element or attributes for
/// a Comment), this returns null. Note that the specialized interfaces may
/// contain additional and more convenient mechanisms to get and set the relevant
/// information.
///
/// This implementation differs in some ways from the W3C DOM recommendations.
/// For example, the DOM specifies that some methods can return null strings.
/// Instead of null strings, this implementation always returns empty strings.
{
public:
enum
{
ELEMENT_NODE = 1, /// The node is an Element.
ATTRIBUTE_NODE, /// The node is an Attr.
TEXT_NODE, /// The node is a Text node.
CDATA_SECTION_NODE, /// The node is a CDATASection.
ENTITY_REFERENCE_NODE, /// The node is an EntityReference.
ENTITY_NODE, /// The node is an Entity.
PROCESSING_INSTRUCTION_NODE, /// The node is a ProcessingInstruction.
COMMENT_NODE, /// The node is a Comment.
DOCUMENT_NODE, /// The node is a Document.
DOCUMENT_TYPE_NODE, /// The node is a DocumentType.
DOCUMENT_FRAGMENT_NODE, /// The node is a DocumentFragment.
NOTATION_NODE /// The node is a Notation.
};
virtual const XMLString& nodeName() const = 0;
/// Returns the name of this node, depending on its type.
const XMLString& nodeValue() const;
/// Returns the value of this node, depending on its type.
virtual const XMLString& getNodeValue() const = 0;
/// Returns the value of this node, depending on its type.
virtual void setNodeValue(const XMLString& value) = 0;
/// Sets the value of this node. Throws an exception
/// if the node is read-only.
virtual unsigned short nodeType() const = 0;
/// Returns a code representing the type of the underlying object.
virtual Node* parentNode() const = 0;
/// The parent of this node. All nodes, except Attr, Document, DocumentFragment,
/// Entity, and Notation may have a parent. However, if a node has just been
/// created and not yet added to the tree, or if it has been removed from the
/// tree, this is null.
virtual NodeList* childNodes() const = 0;
/// Returns a NodeList containing all children of this node.
///
/// The returned NodeList must be released with a call
/// to release() when no longer needed.
virtual Node* firstChild() const = 0;
/// Returns the first child of this node. If there is no such
/// node, this returns null.
virtual Node* lastChild() const = 0;
/// Returns the last child of this node. If there is no such
/// node, this returns null.
virtual Node* previousSibling() const = 0;
/// Returns the node immediately preceding this node. If there
/// is no such node, this returns null.
virtual Node* nextSibling() const = 0;
/// Returns the node immediately following this node. If there
/// is no such node, this returns null.
virtual NamedNodeMap* attributes() const = 0;
/// Returns a NamedNodeMap containing the attributes of this
/// node (if it is an Element) or null otherwise.
///
/// The returned NamedNodeMap must be released with a call
/// to release() when no longer needed.
virtual Document* ownerDocument() const = 0;
/// Returns the Document object associated with this node.
/// This is also the Document object used to create new nodes.
/// When this node is a Document, this is null.
virtual Node* insertBefore(Node* newChild, Node* refChild) = 0;
/// Inserts the node newChild before the existing child node refChild.
///
/// If refChild is null, insert newChild at the end of the list of children.
/// If newChild is a DocumentFragment object, all of its children are
/// inserted in the same order, before refChild. If the newChild is already
/// in the tree, it is first removed.
virtual Node* replaceChild(Node* newChild, Node* oldChild) = 0;
/// Replaces the child node oldChild with newChild in the list of children,
/// and returns the oldChild node.
/// If newChild is a DocumentFragment object, oldChild is replaced by all of
/// the DocumentFragment children, which are inserted in the same order. If
/// the newChild is already in the tree, it is first removed.
virtual Node* removeChild(Node* oldChild) = 0;
/// Removes the child node indicated by oldChild from the list of children
/// and returns it.
virtual Node* appendChild(Node* newChild) = 0;
/// Appends the node newChild to the end of the list of children of this node.
/// If newChild is already in the tree, it is first removed.
virtual bool hasChildNodes() const = 0;
/// This is a convenience method to allow easy determination of whether a
/// node has any children.
/// Returns true if the node has any children, false otherwise.
virtual Node* cloneNode(bool deep) const = 0;
/// Returns a duplicate of this node, i.e., serves as a generic copy constructor
/// for nodes. The duplicate node has no parent; (parentNode is null.).
/// Cloning an Element copies all attributes and their values, including those
/// generated by the XML processor to represent defaulted attributes, but this
/// method does not copy any text it contains unless it is a deep clone, since
/// the text is contained in a child Text node. Cloning an Attribute directly,
/// as opposed to be cloned as part of an Element cloning operation, returns
/// a specified attribute (specified is true). Cloning any other type of node
/// simply returns a copy of this node.
/// Note that cloning an immutable subtree results in a mutable copy, but the
/// children of an EntityReference clone are readonly. In addition, clones of
/// unspecified Attr nodes are specified. And, cloning Document, DocumentType,
/// Entity, and Notation nodes is implementation dependent.
// DOM Level 2
virtual void normalize() = 0;
/// Puts all Text nodes in the full depth of the sub-tree underneath this Node,
/// including attribute nodes, into a "normal" form where only structure (e.g.,
/// elements, comments, processing instructions, CDATA sections, and entity
/// references) separates Text nodes, i.e., there are neither adjacent Text
/// nodes nor empty Text nodes. This can be used to ensure that the DOM view
/// of a document is the same as if it were saved and re-loaded, and is useful
/// when operations (such as XPointer lookups) that depend on a particular
/// document tree structure are to be used.
///
/// Note: In cases where the document contains CDATASections, the normalize
/// operation alone may not be sufficient, since XPointers do not differentiate
/// between Text nodes and CDATASection nodes.
virtual bool isSupported(const XMLString& feature, const XMLString& version) const = 0;
/// Tests whether the DOM implementation implements a specific
/// feature and that feature is supported by this node.
virtual const XMLString& namespaceURI() const = 0;
/// Returns the namespace URI of the node.
/// This is not a computed value that is the result of a namespace lookup based on an
/// examination of the namespace declarations in scope. It is merely the namespace URI
/// given at creation time.
///
/// For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a
/// DOM Level 1 method, such as createElement from the Document interface, this is always the
/// empty string.
virtual XMLString prefix() const = 0;
/// Returns the namespace prefix from the qualified name of the node.
virtual const XMLString& localName() const = 0;
/// Returns the local name of the node.
virtual bool hasAttributes() const = 0;
/// Returns whether this node (if it is an element) has any attributes.
// Extensions
using NSMap = Poco::XML::NamespaceSupport;
virtual XMLString innerText() const = 0;
/// Returns a string containing the concatenated values of the node
/// and all its child nodes.
///
/// This method is not part of the W3C Document Object Model.
virtual Node* getNodeByPath(const XMLString& path) const = 0;
/// Searches a node (element or attribute) based on a simplified XPath
/// expression.
///
/// Only simple XPath expressions are supported. These are the slash
/// notation for specifying paths to elements, and the square bracket
/// expression for finding elements by their index, by attribute value,
/// or finding attributes by names.
///
/// The slash at the beginning is optional, the evaluation always starts
/// at this element. A double-slash at the beginning recursively searches
/// the entire subtree for the first element.
///
/// Examples:
/// elem1/elem2/elem3
/// /elem1/elem2/elem3
/// /elem1/elem2[1]
/// /elem1/elem2[@attr1]
/// /elem1/elem2[@attr1='value']
/// //elem2[@attr1='value']
/// //[@attr1='value']
///
/// This method is an extension to the W3C Document Object Model.
virtual Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const = 0;
/// Searches a node (element or attribute) based on a simplified XPath
/// expression. The given NSMap must contain mappings from namespace
/// prefixes to namespace URIs for all namespace prefixes used in
/// the path expression.
///
/// Only simple XPath expressions are supported. These are the slash
/// notation for specifying paths to elements, and the square bracket
/// expression for finding elements by their index, by attribute value,
/// or finding attributes by names.
///
/// The slash at the beginning is optional, the evaluation always starts
/// at this element. A double-slash at the beginning recursively searches
/// the entire subtree for the first element.
///
/// Examples:
/// /ns1:elem1/ns2:elem2/ns2:elem3
/// /ns1:elem1/ns2:elem2[1]
/// /ns1:elem1/ns2:elem2[@attr1]
/// /ns1:elem1/ns2:elem2[@attr1='value']
/// //ns2:elem2[@ns1:attr1='value']
/// //[@ns1:attr1='value']
///
/// This method is an extension to the W3C Document Object Model.
protected:
virtual ~Node();
};
//
// inlines
//
inline const XMLString& Node::nodeValue() const
{
return getNodeValue();
}
} } // namespace Poco::XML
#endif // DOM_Node_INCLUDED

@ -0,0 +1,81 @@
//
// NodeAppender.h
//
// Library: XML
// Package: DOM
// Module: NodeAppender
//
// Definition of the NodeAppender class.
//
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_NodeAppender_INCLUDED
#define DOM_NodeAppender_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/Node.h"
namespace Poco {
namespace XML {
class AbstractNode;
class Element;
class XML_API NodeAppender
/// The NodeAppender class provides a very fast way to
/// build larger DOM documents.
///
/// In the DOM, child nodes are usually appended to a parent
/// node using the appendChild() method. For nodes containing
/// more than a few children, this method can be quite slow,
/// due to the way it's implemented, and because of the
/// requirements of the DOM specification.
///
/// While the NodeAppender is being used on an Element, no
/// children-modifying methods of that Element must be used.
///
/// This class is not part of the DOM specification.
{
public:
NodeAppender(Element* parent);
/// Creates the NodeAppender for the given parent node,
/// which must be an Element.
~NodeAppender();
/// Destroys the NodeAppender.
void appendChild(Node* newChild);
/// Appends the node newChild to the end of the list of children of
/// the parent node specified in the constructor.
/// If the newChild is already in the tree, it is first removed.
///
/// NewChild can be a DocumentFragment. In this case, all children
/// of the fragment become children of the parent element.
///
/// In order to speed up the function, no DOM events
/// are fired.
private:
NodeAppender();
NodeAppender(const NodeAppender&);
NodeAppender& operator = (const NodeAppender&);
Element* _pParent;
AbstractNode* _pLast;
};
} } // namespace Poco::XML
#endif // #include "Poco/XML/XML.h"

@ -0,0 +1,146 @@
//
// NodeFilter.h
//
// Library: XML
// Package: DOM
// Module: NodeFilter
//
// Definition of the DOM NodeFilter interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_NodeFilter_INCLUDED
#define DOM_NodeFilter_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class Node;
class XML_API NodeFilter
/// Filters are objects that know how to "filter out" nodes. If a NodeIterator
/// or TreeWalker is given a NodeFilter, it applies the filter before it returns
/// the next node. If the filter says to accept the node, the traversal logic
/// returns it; otherwise, traversal looks for the next node and pretends that
/// the node that was rejected was not there.
///
/// The DOM does not provide any filters. NodeFilter is just an interface that
/// users can implement to provide their own filters.
///
/// NodeFilters do not need to know how to traverse from node to node, nor do
/// they need to know anything about the data structure that is being traversed.
/// This makes it very easy to write filters, since the only thing they have
/// to know how to do is evaluate a single node. One filter may be used with
/// a number of different kinds of traversals, encouraging code reuse.
{
public:
enum
{
FILTER_ACCEPT = 1,
/// Accept the node. Navigation methods defined for NodeIterator or TreeWalker will return this node.
FILTER_REJECT = 2,
/// Reject the node. Navigation methods defined for NodeIterator or TreeWalker
/// will not return this node. For TreeWalker, the children of this node will
/// also be rejected. NodeIterators treat this as a synonym for FILTER_SKIP.
FILTER_SKIP = 3
/// Skip this single node. Navigation methods defined for NodeIterator or TreeWalker
/// will not return this node. For both NodeIterator and TreeWalker, the children
/// of this node will still be considered.
};
enum WhatToShow
/// These are the available values for the whatToShow parameter used in TreeWalkers
/// and NodeIterators. They are the same as the set of possible types for Node,
/// and their values are derived by using a bit position corresponding to the
/// value of nodeType for the equivalent node type. If a bit in whatToShow is
/// set false, that will be taken as a request to skip over this type of node;
/// the behavior in that case is similar to that of FILTER_SKIP.
///
/// Note that if node types greater than 32 are ever introduced, they may not
/// be individually testable via whatToShow. If that need should arise, it can
/// be handled by selecting SHOW_ALL together with an appropriate NodeFilter.
{
SHOW_ALL = 0xFFFFFFFF,
/// Show all Nodes.
SHOW_ELEMENT = 0x00000001,
/// Show Element nodes.
SHOW_ATTRIBUTE = 0x00000002,
/// Show Attr nodes. This is meaningful only when creating an iterator or tree-walker
/// with an attribute node as its root; in this case, it means that the attribute
/// node will appear in the first position of the iteration or traversal. Since
/// attributes are never children of other nodes, they do not appear when traversing
/// over the document tree.
SHOW_TEXT = 0x00000004,
/// Show Text nodes.
SHOW_CDATA_SECTION = 0x00000008,
/// Show CDATASection nodes.
SHOW_ENTITY_REFERENCE = 0x00000010,
/// Show EntityReference nodes.
SHOW_ENTITY = 0x00000020,
/// Show Entity nodes. This is meaningful only when creating an iterator or
/// tree-walker with an Entity node as its root; in this case, it means that
/// the Entity node will appear in the first position of the traversal. Since
/// entities are not part of the document tree, they do not appear when traversing
/// over the document tree.
SHOW_PROCESSING_INSTRUCTION = 0x00000040,
/// Show ProcessingInstruction nodes.
SHOW_COMMENT = 0x00000080,
/// Show Comment nodes.
SHOW_DOCUMENT = 0x00000100,
/// Show Document nodes.
SHOW_DOCUMENT_TYPE = 0x00000200,
/// Show DocumentType nodes.
SHOW_DOCUMENT_FRAGMENT = 0x00000400,
/// Show DocumentFragment nodes.
SHOW_NOTATION = 0x00000800
/// Show Notation nodes. This is meaningful only when creating an iterator or
/// tree-walker with a Notation node as its root; in this case, it means that
/// the Notation node will appear in the first position of the traversal. Since
/// notations are not part of the document tree, they do not appear when traversing
/// over the document tree.
};
virtual short acceptNode(Node* node) = 0;
/// Test whether a specified node is visible in the logical view of a TreeWalker
/// or NodeIterator. This function will be called by the implementation of TreeWalker
/// and NodeIterator; it is not normally called directly from user code. (Though
/// you could do so if you wanted to use the same filter to guide your own application
/// logic.)
///
/// Returns FILTER_ACCEPT, FILTER_REJECT or FILTER_SKIP.
protected:
virtual ~NodeFilter();
};
} } // namespace Poco::XML
#endif // DOM_NodeFilter_INCLUDED

@ -0,0 +1,167 @@
//
// NodeIterator.h
//
// Library: XML
// Package: DOM
// Module: NodeIterator
//
// Definition of the DOM NodeIterator class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_NodeIterator_INCLUDED
#define DOM_NodeIterator_INCLUDED
#include "Poco/XML/XML.h"
namespace Poco {
namespace XML {
class Node;
class NodeFilter;
class XML_API NodeIterator
/// Iterators are used to step through a set of nodes, e.g. the set of nodes
/// in a NodeList, the document subtree governed by a particular Node, the results
/// of a query, or any other set of nodes. The set of nodes to be iterated is
/// determined by the implementation of the NodeIterator. DOM Level 2 specifies
/// a single NodeIterator implementation for document-order traversal of a document
/// subtree.
///
/// A NodeIterator can be directly instantiated using one of its constructors -
/// the DocumentTraversal interface is not needed and therefore not implemented.
/// Unlike most other DOM classes, NodeIterator supports value semantics.
///
/// If the NodeIterator's current node is removed from the document, the
/// result of calling any of the movement methods is undefined. This behavior does
/// not conform to the DOM Level 2 Traversal specification.
{
public:
NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0);
/// Creates a NodeIterator over the subtree rooted at the specified node.
NodeIterator(const NodeIterator& iterator);
/// Creates a NodeIterator by copying another NodeIterator.
NodeIterator& operator = (const NodeIterator& iterator);
/// Assignment operator.
~NodeIterator();
/// Destroys the NodeIterator.
Node* root() const;
/// The root node of the NodeIterator, as specified when it was created.
unsigned long whatToShow() const;
/// This attribute determines which node types are presented via the iterator.
/// The available set of constants is defined in the NodeFilter interface.
/// Nodes not accepted by whatToShow will be skipped, but their children may
/// still be considered. Note that this skip takes precedence over the filter,
/// if any.
NodeFilter* filter() const;
/// The NodeFilter used to screen nodes.
bool expandEntityReferences() const;
/// The value of this flag determines whether the children of entity reference
/// nodes are visible to the iterator. If false, they and their descendants
/// will be rejected. Note that this rejection takes precedence over whatToShow
/// and the filter. Also note that this is currently the only situation where
/// NodeIterators may reject a complete subtree rather than skipping individual
/// nodes.
///
/// To produce a view of the document that has entity references expanded and
/// does not expose the entity reference node itself, use the whatToShow flags
/// to hide the entity reference node and set expandEntityReferences to true
/// when creating the iterator. To produce a view of the document that has entity
/// reference nodes but no entity expansion, use the whatToShow flags to show
/// the entity reference node and set expandEntityReferences to false.
///
/// This implementation does not support entity reference expansion and
/// thus always returns false.
Node* nextNode();
/// Returns the next node in the set and advances the position of the iterator
/// in the set. After a NodeIterator is created, the first call to nextNode()
/// returns the first node in the set.
Node* previousNode();
/// Returns the previous node in the set and moves the position of the NodeIterator
/// backwards in the set.
Node* currentNodeNP() const;
/// Returns the current node in the set.
///
/// Leaves the NodeIterator unchanged.
///
/// Warning: This is a proprietary extension to the DOM Level 2 NodeIterator
/// interface.
void detach();
/// Detaches the NodeIterator from the set which it iterated over, releasing
/// any computational resources and placing the iterator in the INVALID state.
/// After detach has been invoked, calls to nextNode or previousNode will raise
/// the exception INVALID_STATE_ERR.
protected:
bool accept(Node* pNode) const;
Node* next() const;
Node* previous() const;
Node* last();
private:
NodeIterator();
Node* _pRoot;
unsigned long _whatToShow;
NodeFilter* _pFilter;
Node* _pCurrent;
};
//
// inlines
//
inline Node* NodeIterator::root() const
{
return _pRoot;
}
inline Node* NodeIterator::currentNodeNP() const
{
return _pCurrent;
}
inline unsigned long NodeIterator::whatToShow() const
{
return _whatToShow;
}
inline NodeFilter* NodeIterator::filter() const
{
return _pFilter;
}
inline bool NodeIterator::expandEntityReferences() const
{
return false;
}
} } // namespace Poco::XML
#endif // DOM_NodeIterator_INCLUDED

@ -0,0 +1,61 @@
//
// NodeList.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM NodeList interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_NodeList_INCLUDED
#define DOM_NodeList_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/DOMObject.h"
namespace Poco {
namespace XML {
class Node;
class XML_API NodeList: public DOMObject
/// The NodeList interface provides the abstraction of an ordered
/// collection of nodes, without defining or constraining how this
/// collection is implemented.
///
/// The items in the NodeList are accessible via an integral index,
/// starting from 0.
///
/// A NodeList returned from a method must be released with a call to
/// release() when no longer needed.
{
public:
virtual Node* item(unsigned long index) const = 0;
/// Returns the index'th item in the collection. If index is
/// greater than or equal to the number of nodes in the list,
/// this returns null.
virtual unsigned long length() const = 0;
/// Returns the number of nodes in the list. The range of valid
/// node indices is 0 to length - 1 inclusive.
protected:
virtual ~NodeList();
};
} } // namespace Poco::XML
#endif // DOM_NodeList_INCLUDED

@ -0,0 +1,93 @@
//
// Notation.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Notation class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Notation_INCLUDED
#define DOM_Notation_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractNode.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API Notation: public AbstractNode
/// This interface represents a notation declared in the DTD. A notation either
/// declares, by name, the format of an unparsed entity (see section 4.7 of
/// the XML 1.0 specification <http://www.w3.org/TR/2004/REC-xml-20040204/>),
/// or is used for formal declaration of processing
/// instruction targets (see section 2.6 of the XML 1.0 specification).
/// The nodeName attribute inherited from Node is set to the declared name of
/// the notation.
///
/// The DOM Level 1 does not support editing Notation nodes; they are therefore
/// readonly.
///
/// A Notation node does not have any parent.
{
public:
const XMLString& publicId() const;
/// Returns the public identifier of this notation.
/// If not specified, this is an empty string (and not null,
/// as in the DOM specification).
const XMLString& systemId() const;
/// Returns the system identifier of this notation.
/// If not specified, this is an empty string (and not null,
/// as in the DOM specification).
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
protected:
Notation(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId);
Notation(Document* pOwnerDocument, const Notation& notation);
~Notation();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
XMLString _name;
XMLString _publicId;
XMLString _systemId;
friend class Document;
};
//
// inlines
//
inline const XMLString& Notation::publicId() const
{
return _publicId;
}
inline const XMLString& Notation::systemId() const
{
return _systemId;
}
} } // namespace Poco::XML
#endif // DOM_Notation_INCLUDED

@ -0,0 +1,99 @@
//
// ProcessingInstruction.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM ProcessingInstruction class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_ProcessingInstruction_INCLUDED
#define DOM_ProcessingInstruction_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractNode.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API ProcessingInstruction: public AbstractNode
/// The ProcessingInstruction interface represents a "processing instruction",
/// used in XML as a way to keep processor-specific information in the text
/// of the document.
{
public:
const XMLString& target() const;
/// Returns the target of this processing instruction.
/// XML defines this as being the first token following
/// the markup that begins the processing instruction.
const XMLString& data() const;
/// Returns the content of this processing instruction. This is from the first non
/// white space character after the target to the character immediately preceding
/// the ?>.
const XMLString& getData() const;
/// Returns the content of this processing instruction. This is from the first non
/// white space character after the target to the character immediately preceding
/// the ?>.
void setData(const XMLString& data);
/// Sets the content of this processing instruction.
// Node
const XMLString& nodeName() const;
const XMLString& getNodeValue() const;
void setNodeValue(const XMLString& data);
unsigned short nodeType() const;
protected:
ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data);
ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction);
~ProcessingInstruction();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
XMLString _target;
XMLString _data;
friend class Document;
};
//
// inlines
//
inline const XMLString& ProcessingInstruction::target() const
{
return _target;
}
inline const XMLString& ProcessingInstruction::data() const
{
return _data;
}
inline const XMLString& ProcessingInstruction::getData() const
{
return _data;
}
} } // namespace Poco::XML
#endif // DOM_ProcessingInstruction_INCLUDED

79
vendor/POCO/XML/include/Poco/DOM/Text.h vendored Normal file

@ -0,0 +1,79 @@
//
// Text.h
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Definition of the DOM Text class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_Text_INCLUDED
#define DOM_Text_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/DOM/CharacterData.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class XML_API Text: public CharacterData
/// The Text interface inherits from CharacterData and represents the textual
/// content (termed character data in XML) of an Element or Attr. If there is
/// no markup inside an element's content, the text is contained in a single
/// object implementing the Text interface that is the only child of the element.
/// If there is markup, it is parsed into the information items (elements, comments,
/// etc.) and Text nodes that form the list of children of the element.
///
/// When a document is first made available via the DOM, there is only one Text
/// node for each block of text. Users may create adjacent Text nodes that represent
/// the contents of a given element without any intervening markup, but should
/// be aware that there is no way to represent the separations between these
/// nodes in XML or HTML, so they will not (in general) persist between DOM
/// editing sessions. The normalize() method on Element merges any such adjacent
/// Text objects into a single node for each block of text.
{
public:
Text* splitText(unsigned long offset);
/// Breaks this node into two nodes at the specified offset, keeping both in
/// the tree as siblings. This node then only contains all the content up to
/// the offset point. A new node of the same type, which is inserted as the
/// next sibling of this node, contains all the content at and after the offset
/// point. When the offset is equal to the length of this node, the new node
/// has no data.
// Node
const XMLString& nodeName() const;
unsigned short nodeType() const;
// Non-standard extensions
XMLString innerText() const;
protected:
Text(Document* pOwnerDocument, const XMLString& data);
Text(Document* pOwnerDocument, const Text& text);
~Text();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
static const XMLString NODE_NAME;
friend class Document;
};
} } // namespace Poco::XML
#endif // DOM_Text_INCLUDED

@ -0,0 +1,211 @@
//
// TreeWalker.h
//
// Library: XML
// Package: DOM
// Module: TreeWalker
//
// Definition of the DOM TreeWalker class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef DOM_TreeWalker_INCLUDED
#define DOM_TreeWalker_INCLUDED
#include "Poco/XML/XML.h"
#include "Poco/XML/XMLString.h"
namespace Poco {
namespace XML {
class Node;
class NodeFilter;
class XML_API TreeWalker
/// TreeWalker objects are used to navigate a document tree or subtree using
/// the view of the document defined by their whatToShow flags and filter (if
/// any). Any function which performs navigation using a TreeWalker will automatically
/// support any view defined by a TreeWalker.
///
/// Omitting nodes from the logical view of a subtree can result in a structure
/// that is substantially different from the same subtree in the complete, unfiltered
/// document. Nodes that are siblings in the TreeWalker view may be children
/// of different, widely separated nodes in the original view. For instance,
/// consider a NodeFilter that skips all nodes except for Text nodes and the
/// root node of a document. In the logical view that results, all text nodes
/// will be siblings and appear as direct children of the root node, no matter
/// how deeply nested the structure of the original document.
///
/// A TreeWalker can be directly instantiated using one of its constructors -
/// the DocumentTraversal interface is not needed and therefore not implemented.
/// Unlike most other DOM classes, TreeWalker supports value semantics.
///
/// If the TreeWalker's current node is removed from the document, the
/// result of calling any of the movement methods is undefined. This behavior
/// does not conform to the DOM Level 2 Traversal specification.
{
public:
TreeWalker(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0);
/// Creates a TreeWalker over the subtree rooted at the specified node.
TreeWalker(const TreeWalker& walker);
/// Creates a TreeWalker by copying another TreeWalker.
TreeWalker& operator = (const TreeWalker& walker);
/// Assignment operator.
~TreeWalker();
/// Destroys the TreeWalker.
Node* root() const;
/// The root node of the TreeWalker, as specified when it was created.
unsigned long whatToShow() const;
/// This attribute determines which node types are presented via the TreeWalker.
/// The available set of constants is defined in the NodeFilter interface. Nodes
/// not accepted by whatToShow will be skipped, but their children may still
/// be considered. Note that this skip takes precedence over the filter, if
/// any.
NodeFilter* filter() const;
/// The NodeFilter used to screen nodes.
bool expandEntityReferences() const;
/// The value of this flag determines whether the children of entity reference
/// nodes are visible to the iterator. If false, they and their descendants
/// will be rejected. Note that this rejection takes precedence over whatToShow
/// and the filter. Also note that this is currently the only situation where
/// NodeIterators may reject a complete subtree rather than skipping individual
/// nodes.
///
/// To produce a view of the document that has entity references expanded and
/// does not expose the entity reference node itself, use the whatToShow flags
/// to hide the entity reference node and set expandEntityReferences to true
/// when creating the iterator. To produce a view of the document that has entity
/// reference nodes but no entity expansion, use the whatToShow flags to show
/// the entity reference node and set expandEntityReferences to false.
///
/// This implementation does not support entity reference expansion and
/// thus always returns false.
Node* currentNode() const;
/// The node at which the TreeWalker is currently positioned.
/// Alterations to the DOM tree may cause the current node to no longer be accepted
/// by the TreeWalker's associated filter. currentNode may also be explicitly
/// set to any node, whether or not it is within the subtree specified by the
/// root node or would be accepted by the filter and whatToShow flags. Further
/// traversal occurs relative to currentNode even if it is not part of the current
/// view, by applying the filters in the requested direction; if no traversal
/// is possible, currentNode is not changed.
Node* getCurrentNode() const;
/// See currentNode().
void setCurrentNode(Node* pNode);
/// Sets the current node.
Node* parentNode();
/// Moves to and returns the closest visible ancestor node of the current node.
/// If the search for parentNode attempts to step upward from the TreeWalker's
/// root node, or if it fails to find a visible ancestor node, this method retains
/// the current position and returns null.
Node* firstChild();
/// Moves the TreeWalker to the first visible child of the current node, and
/// returns the new node. If the current node has no visible children, returns
/// null, and retains the current node.
Node* lastChild();
/// Moves the TreeWalker to the last visible child of the current node, and
/// returns the new node. If the current node has no visible children, returns
/// null, and retains the current node.
Node* previousSibling();
/// Moves the TreeWalker to the previous sibling of the current node, and returns
/// the new node. If the current node has no visible previous sibling, returns
/// null, and retains the current node.
Node* nextSibling();
/// Moves the TreeWalker to the next sibling of the current node, and returns
/// the new node. If the current node has no visible next sibling, returns null,
/// and retains the current node.
Node* previousNode();
/// Moves the TreeWalker to the previous visible node in document order relative
/// to the current node, and returns the new node. If the current node has no
/// previous node, or if the search for previousNode attempts to step upward
/// from the TreeWalker's root node, returns null, and retains the current node.
Node* nextNode();
/// Moves the TreeWalker to the next visible node in document order relative
/// to the current node, and returns the new node. If the current node has no
/// next node, or if the search for nextNode attempts to step upward from the
/// TreeWalker's root node, returns null, and retains the current node.
protected:
int accept(Node* pNode) const;
Node* next(Node* pNode) const;
Node* previous(Node* pNode) const;
private:
TreeWalker();
Node* _pRoot;
unsigned long _whatToShow;
NodeFilter* _pFilter;
Node* _pCurrent;
};
//
// inlines
//
inline Node* TreeWalker::root() const
{
return _pRoot;
}
inline unsigned long TreeWalker::whatToShow() const
{
return _whatToShow;
}
inline NodeFilter* TreeWalker::filter() const
{
return _pFilter;
}
inline bool TreeWalker::expandEntityReferences() const
{
return false;
}
inline Node* TreeWalker::currentNode() const
{
return _pCurrent;
}
inline Node* TreeWalker::getCurrentNode() const
{
return _pCurrent;
}
} } // namespace Poco::XML
#endif // DOM_TreeWalker_INCLUDED