diff --git a/xerces-c/BUILD.gn b/xerces-c/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..e1950f76cf055d14c557af8e3bb59dfdc6880923 --- /dev/null +++ b/xerces-c/BUILD.gn @@ -0,0 +1,954 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +declare_args() { + enable_xerces_test = false +} + +config("libxerces-c_config") { + cflags_cc = [ + "-frtti", + "-fexceptions", + "-Wno-header-hygiene", + "-DHAVE_CONFIG_H=1", + "-DXERCES_BUILDING_LIBRARY=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-DXERCES_USE_TRANSCODER_ICU=1", + "-Dxerces_c_EXPORTS", + "-Wno-long-long", + "-Woverlength-strings", + "-Woverloaded-virtual", + "-Wno-variadic-macros", + "-Wno-misleading-indentation", + "-Wno-memset-transposed-args", + "-Wno-unused-variable", + "-fstrict-aliasing", + "-fPIC", + ] + + cflags = [ + "-DHAVE_CONFIG_H=1", + "-DXERCES_BUILDING_LIBRARY=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-Dxerces_c_EXPORTS", + "-fPIC", + ] + + include_dirs = [ + "xerces-c/src", + "xerces-c", + "adapted", + "//third_party/icu/icu4c/source/common", + ] +} + +ohos_shared_library("libxerces-c") { + sources= [ + "xerces-c/src/xercesc/util/Base64.cpp", + "xerces-c/src/xercesc/util/BinFileInputStream.cpp", + "xerces-c/src/xercesc/util/BinInputStream.cpp", + "xerces-c/src/xercesc/util/BinMemInputStream.cpp", + "xerces-c/src/xercesc/util/BitSet.cpp", + "xerces-c/src/xercesc/util/DefaultPanicHandler.cpp", + "xerces-c/src/xercesc/util/EncodingValidator.cpp", + "xerces-c/src/xercesc/util/HeaderDummy.cpp", + "xerces-c/src/xercesc/util/HexBin.cpp", + "xerces-c/src/xercesc/util/JanitorExports.cpp", + "xerces-c/src/xercesc/util/KVStringPair.cpp", + "xerces-c/src/xercesc/util/Mutexes.cpp", + "xerces-c/src/xercesc/util/PanicHandler.cpp", + "xerces-c/src/xercesc/util/PlatformUtils.cpp", + "xerces-c/src/xercesc/util/PSVIUni.cpp", + "xerces-c/src/xercesc/util/QName.cpp", + "xerces-c/src/xercesc/util/regx/ASCIIRangeFactory.cpp", + "xerces-c/src/xercesc/util/regx/BlockRangeFactory.cpp", + "xerces-c/src/xercesc/util/regx/BMPattern.cpp", + "xerces-c/src/xercesc/util/regx/CharToken.cpp", + "xerces-c/src/xercesc/util/regx/ClosureToken.cpp", + "xerces-c/src/xercesc/util/regx/ConcatToken.cpp", + "xerces-c/src/xercesc/util/regx/Match.cpp", + "xerces-c/src/xercesc/util/regx/Op.cpp", + "xerces-c/src/xercesc/util/regx/OpFactory.cpp", + "xerces-c/src/xercesc/util/regx/ParenToken.cpp", + "xerces-c/src/xercesc/util/regx/ParserForXMLSchema.cpp", + "xerces-c/src/xercesc/util/regx/RangeFactory.cpp", + "xerces-c/src/xercesc/util/regx/RangeToken.cpp", + "xerces-c/src/xercesc/util/regx/RangeTokenMap.cpp", + "xerces-c/src/xercesc/util/regx/RegularExpression.cpp", + "xerces-c/src/xercesc/util/regx/RegxParser.cpp", + "xerces-c/src/xercesc/util/regx/RegxUtil.cpp", + "xerces-c/src/xercesc/util/regx/StringToken.cpp", + "xerces-c/src/xercesc/util/regx/Token.cpp", + "xerces-c/src/xercesc/util/regx/TokenFactory.cpp", + "xerces-c/src/xercesc/util/regx/UnicodeRangeFactory.cpp", + "xerces-c/src/xercesc/util/regx/UnionToken.cpp", + "xerces-c/src/xercesc/util/regx/XMLRangeFactory.cpp", + "xerces-c/src/xercesc/util/regx/XMLUniCharacter.cpp", + "xerces-c/src/xercesc/util/StringPool.cpp", + "xerces-c/src/xercesc/util/SynchronizedStringPool.cpp", + "xerces-c/src/xercesc/util/TransService.cpp", + "xerces-c/src/xercesc/util/XMemory.cpp", + "xerces-c/src/xercesc/util/XML256TableTranscoder.cpp", + "xerces-c/src/xercesc/util/XML88591Transcoder.cpp", + "xerces-c/src/xercesc/util/XMLAbstractDoubleFloat.cpp", + "xerces-c/src/xercesc/util/XMLASCIITranscoder.cpp", + "xerces-c/src/xercesc/util/XMLBigDecimal.cpp", + "xerces-c/src/xercesc/util/XMLBigInteger.cpp", + "xerces-c/src/xercesc/util/XMLChar.cpp", + "xerces-c/src/xercesc/util/XMLChTranscoder.cpp", + "xerces-c/src/xercesc/util/XMLDateTime.cpp", + "xerces-c/src/xercesc/util/XMLDouble.cpp", + "xerces-c/src/xercesc/util/XMLEBCDICTranscoder.cpp", + "xerces-c/src/xercesc/util/XMLException.cpp", + "xerces-c/src/xercesc/util/XMLFloat.cpp", + "xerces-c/src/xercesc/util/XMLIBM1047Transcoder.cpp", + "xerces-c/src/xercesc/util/XMLIBM1140Transcoder.cpp", + "xerces-c/src/xercesc/util/XMLInitializer.cpp", + "xerces-c/src/xercesc/util/XMLMsgLoader.cpp", + "xerces-c/src/xercesc/util/XMLNumber.cpp", + "xerces-c/src/xercesc/util/XMLString.cpp", + "xerces-c/src/xercesc/util/XMLStringTokenizer.cpp", + "xerces-c/src/xercesc/util/XMLUCS4Transcoder.cpp", + "xerces-c/src/xercesc/util/XMLUni.cpp", + "xerces-c/src/xercesc/util/XMLUri.cpp", + "xerces-c/src/xercesc/util/XMLURL.cpp", + "xerces-c/src/xercesc/util/XMLUTF16Transcoder.cpp", + "xerces-c/src/xercesc/util/XMLUTF8Transcoder.cpp", + "xerces-c/src/xercesc/util/XMLWin1252Transcoder.cpp", + "xerces-c/src/xercesc/dom/DOMException.cpp", + "xerces-c/src/xercesc/dom/DOMLSException.cpp", + "xerces-c/src/xercesc/dom/DOMRangeException.cpp", + "xerces-c/src/xercesc/dom/DOMXPathException.cpp", + "xerces-c/src/xercesc/dom/impl/DOMAttrImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMAttrMapImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMAttrNSImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMCharacterDataImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMChildNode.cpp", + "xerces-c/src/xercesc/dom/impl/DOMCommentImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMConfigurationImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMDeepNodeListImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMDocumentImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMElementImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMElementNSImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMEntityImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMErrorImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMImplementationImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMImplementationListImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMImplementationRegistry.cpp", + "xerces-c/src/xercesc/dom/impl/DOMLocatorImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNamedNodeMapImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNodeIDMap.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNodeImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNodeIteratorImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNodeListImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNodeVector.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNormalizer.cpp", + "xerces-c/src/xercesc/dom/impl/DOMNotationImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMParentNode.cpp", + "xerces-c/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMRangeImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMStringListImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMStringPool.cpp", + "xerces-c/src/xercesc/dom/impl/DOMTextImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMTreeWalkerImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMTypeInfoImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMLSInputImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMLSOutputImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMXPathExpressionImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMXPathNSResolverImpl.cpp", + "xerces-c/src/xercesc/dom/impl/DOMXPathResultImpl.cpp", + "xerces-c/src/xercesc/dom/impl/XSDElementNSImpl.cpp", + "xerces-c/src/xercesc/framework/BinOutputStream.cpp", + "xerces-c/src/xercesc/framework/LocalFileFormatTarget.cpp", + "xerces-c/src/xercesc/framework/LocalFileInputSource.cpp", + "xerces-c/src/xercesc/framework/MemBufFormatTarget.cpp", + "xerces-c/src/xercesc/framework/MemBufInputSource.cpp", + "xerces-c/src/xercesc/framework/psvi/PSVIAttribute.cpp", + "xerces-c/src/xercesc/framework/psvi/PSVIAttributeList.cpp", + "xerces-c/src/xercesc/framework/psvi/PSVIElement.cpp", + "xerces-c/src/xercesc/framework/psvi/PSVIItem.cpp", + "xerces-c/src/xercesc/framework/psvi/XSAnnotation.cpp", + "xerces-c/src/xercesc/framework/psvi/XSAttributeDeclaration.cpp", + "xerces-c/src/xercesc/framework/psvi/XSAttributeGroupDefinition.cpp", + "xerces-c/src/xercesc/framework/psvi/XSAttributeUse.cpp", + "xerces-c/src/xercesc/framework/psvi/XSComplexTypeDefinition.cpp", + "xerces-c/src/xercesc/framework/psvi/XSElementDeclaration.cpp", + "xerces-c/src/xercesc/framework/psvi/XSFacet.cpp", + "xerces-c/src/xercesc/framework/psvi/XSIDCDefinition.cpp", + "xerces-c/src/xercesc/framework/psvi/XSModel.cpp", + "xerces-c/src/xercesc/framework/psvi/XSModelGroup.cpp", + "xerces-c/src/xercesc/framework/psvi/XSModelGroupDefinition.cpp", + "xerces-c/src/xercesc/framework/psvi/XSMultiValueFacet.cpp", + "xerces-c/src/xercesc/framework/psvi/XSNamespaceItem.cpp", + "xerces-c/src/xercesc/framework/psvi/XSNotationDeclaration.cpp", + "xerces-c/src/xercesc/framework/psvi/XSObject.cpp", + "xerces-c/src/xercesc/framework/psvi/XSParticle.cpp", + "xerces-c/src/xercesc/framework/psvi/XSSimpleTypeDefinition.cpp", + "xerces-c/src/xercesc/framework/psvi/XSTypeDefinition.cpp", + "xerces-c/src/xercesc/framework/psvi/XSValue.cpp", + "xerces-c/src/xercesc/framework/psvi/XSWildcard.cpp", + "xerces-c/src/xercesc/framework/StdInInputSource.cpp", + "xerces-c/src/xercesc/framework/StdOutFormatTarget.cpp", + "xerces-c/src/xercesc/framework/URLInputSource.cpp", + "xerces-c/src/xercesc/framework/Wrapper4DOMLSInput.cpp", + "xerces-c/src/xercesc/framework/Wrapper4InputSource.cpp", + "xerces-c/src/xercesc/framework/XMLAttDef.cpp", + "xerces-c/src/xercesc/framework/XMLAttDefList.cpp", + "xerces-c/src/xercesc/framework/XMLAttr.cpp", + "xerces-c/src/xercesc/framework/XMLBuffer.cpp", + "xerces-c/src/xercesc/framework/XMLBufferMgr.cpp", + "xerces-c/src/xercesc/framework/XMLContentModel.cpp", + "xerces-c/src/xercesc/framework/XMLDTDDescription.cpp", + "xerces-c/src/xercesc/framework/XMLElementDecl.cpp", + "xerces-c/src/xercesc/framework/XMLEntityDecl.cpp", + "xerces-c/src/xercesc/framework/XMLFormatter.cpp", + "xerces-c/src/xercesc/framework/XMLGrammarDescription.cpp", + "xerces-c/src/xercesc/framework/XMLGrammarPoolImpl.cpp", + "xerces-c/src/xercesc/framework/XMLNotationDecl.cpp", + "xerces-c/src/xercesc/framework/XMLRecognizer.cpp", + "xerces-c/src/xercesc/framework/XMLRefInfo.cpp", + "xerces-c/src/xercesc/framework/XMLSchemaDescription.cpp", + "xerces-c/src/xercesc/framework/XMLValidator.cpp", + "xerces-c/src/xercesc/internal/BinFileOutputStream.cpp", + "xerces-c/src/xercesc/internal/BinMemOutputStream.cpp", + "xerces-c/src/xercesc/internal/DGXMLScanner.cpp", + "xerces-c/src/xercesc/internal/ElemStack.cpp", + "xerces-c/src/xercesc/internal/IGXMLScanner.cpp", + "xerces-c/src/xercesc/internal/IGXMLScanner2.cpp", + "xerces-c/src/xercesc/internal/MemoryManagerImpl.cpp", + "xerces-c/src/xercesc/internal/ReaderMgr.cpp", + "xerces-c/src/xercesc/internal/SGXMLScanner.cpp", + "xerces-c/src/xercesc/internal/ValidationContextImpl.cpp", + "xerces-c/src/xercesc/internal/VecAttributesImpl.cpp", + "xerces-c/src/xercesc/internal/VecAttrListImpl.cpp", + "xerces-c/src/xercesc/internal/WFXMLScanner.cpp", + "xerces-c/src/xercesc/internal/XMLReader.cpp", + "xerces-c/src/xercesc/internal/XMLScanner.cpp", + "xerces-c/src/xercesc/internal/XMLScannerResolver.cpp", + "xerces-c/src/xercesc/internal/XProtoType.cpp", + "xerces-c/src/xercesc/internal/XSAXMLScanner.cpp", + "xerces-c/src/xercesc/internal/XSerializeEngine.cpp", + "xerces-c/src/xercesc/internal/XSObjectFactory.cpp", + "xerces-c/src/xercesc/internal/XTemplateSerializer.cpp", + "xerces-c/src/xercesc/parsers/AbstractDOMParser.cpp", + "xerces-c/src/xercesc/parsers/DOMLSParserImpl.cpp", + "xerces-c/src/xercesc/parsers/SAX2XMLFilterImpl.cpp", + "xerces-c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp", + "xerces-c/src/xercesc/parsers/SAXParser.cpp", + "xerces-c/src/xercesc/parsers/XercesDOMParser.cpp", + "xerces-c/src/xercesc/sax/Dummy.cpp", + "xerces-c/src/xercesc/sax/InputSource.cpp", + "xerces-c/src/xercesc/sax/SAXException.cpp", + "xerces-c/src/xercesc/sax/SAXParseException.cpp", + "xerces-c/src/xercesc/sax2/sax2Dummy.cpp", + "xerces-c/src/xercesc/validators/common/AllContentModel.cpp", + "xerces-c/src/xercesc/validators/common/CMAny.cpp", + "xerces-c/src/xercesc/validators/common/CMBinaryOp.cpp", + "xerces-c/src/xercesc/validators/common/CMUnaryOp.cpp", + "xerces-c/src/xercesc/validators/common/ContentLeafNameTypeVector.cpp", + "xerces-c/src/xercesc/validators/common/ContentSpecNode.cpp", + "xerces-c/src/xercesc/validators/common/DFAContentModel.cpp", + "xerces-c/src/xercesc/validators/common/Grammar.cpp", + "xerces-c/src/xercesc/validators/common/GrammarResolver.cpp", + "xerces-c/src/xercesc/validators/common/MixedContentModel.cpp", + "xerces-c/src/xercesc/validators/common/SimpleContentModel.cpp", + "xerces-c/src/xercesc/validators/datatype/AbstractNumericFacetValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/AbstractNumericValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/AbstractStringValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/AnyURIDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DatatypeValidatorFactory.cpp", + "xerces-c/src/xercesc/validators/datatype/DateDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DateTimeDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DateTimeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DayDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DoubleDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/DurationDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/ENTITYDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/FloatDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/IDDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/IDREFDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/ListDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/MonthDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/MonthDayDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/NameDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/NCNameDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/QNameDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/StringDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/TimeDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/XMLCanRepGroup.cpp", + "xerces-c/src/xercesc/validators/datatype/YearDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/datatype/YearMonthDatatypeValidator.cpp", + "xerces-c/src/xercesc/validators/DTD/DTDAttDef.cpp", + "xerces-c/src/xercesc/validators/DTD/DTDAttDefList.cpp", + "xerces-c/src/xercesc/validators/DTD/DTDElementDecl.cpp", + "xerces-c/src/xercesc/validators/DTD/DTDEntityDecl.cpp", + "xerces-c/src/xercesc/validators/DTD/DTDGrammar.cpp", + "xerces-c/src/xercesc/validators/DTD/DTDScanner.cpp", + "xerces-c/src/xercesc/validators/DTD/DTDValidator.cpp", + "xerces-c/src/xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp", + "xerces-c/src/xercesc/validators/schema/ComplexTypeInfo.cpp", + "xerces-c/src/xercesc/validators/schema/GeneralAttributeCheck.cpp", + "xerces-c/src/xercesc/validators/schema/identity/FieldActivator.cpp", + "xerces-c/src/xercesc/validators/schema/identity/FieldValueMap.cpp", + "xerces-c/src/xercesc/validators/schema/identity/IC_Field.cpp", + "xerces-c/src/xercesc/validators/schema/identity/IC_Key.cpp", + "xerces-c/src/xercesc/validators/schema/identity/IC_KeyRef.cpp", + "xerces-c/src/xercesc/validators/schema/identity/IC_Selector.cpp", + "xerces-c/src/xercesc/validators/schema/identity/IC_Unique.cpp", + "xerces-c/src/xercesc/validators/schema/identity/IdentityConstraint.cpp", + "xerces-c/src/xercesc/validators/schema/identity/IdentityConstraintHandler.cpp", + "xerces-c/src/xercesc/validators/schema/identity/ValueStore.cpp", + "xerces-c/src/xercesc/validators/schema/identity/ValueStoreCache.cpp", + "xerces-c/src/xercesc/validators/schema/identity/XercesXPath.cpp", + "xerces-c/src/xercesc/validators/schema/identity/XPathMatcher.cpp", + "xerces-c/src/xercesc/validators/schema/identity/XPathMatcherStack.cpp", + "xerces-c/src/xercesc/validators/schema/identity/XPathSymbols.cpp", + "xerces-c/src/xercesc/validators/schema/NamespaceScope.cpp", + "xerces-c/src/xercesc/validators/schema/SchemaAttDef.cpp", + "xerces-c/src/xercesc/validators/schema/SchemaAttDefList.cpp", + "xerces-c/src/xercesc/validators/schema/SchemaElementDecl.cpp", + "xerces-c/src/xercesc/validators/schema/SchemaGrammar.cpp", + "xerces-c/src/xercesc/validators/schema/SchemaInfo.cpp", + "xerces-c/src/xercesc/validators/schema/SchemaSymbols.cpp", + "xerces-c/src/xercesc/validators/schema/SchemaValidator.cpp", + "xerces-c/src/xercesc/validators/schema/SubstitutionGroupComparator.cpp", + "xerces-c/src/xercesc/validators/schema/TraverseSchema.cpp", + "xerces-c/src/xercesc/validators/schema/XercesAttGroupInfo.cpp", + "xerces-c/src/xercesc/validators/schema/XercesElementWildcard.cpp", + "xerces-c/src/xercesc/validators/schema/XercesGroupInfo.cpp", + "xerces-c/src/xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp", + "xerces-c/src/xercesc/validators/schema/XSDDOMParser.cpp", + "xerces-c/src/xercesc/validators/schema/XSDErrorReporter.cpp", + "xerces-c/src/xercesc/validators/schema/XSDLocator.cpp", + "xerces-c/src/xercesc/validators/schema/XUtil.cpp", + "xerces-c/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp", + "xerces-c/src/xercesc/xinclude/XIncludeLocation.cpp", + "xerces-c/src/xercesc/xinclude/XIncludeUtils.cpp", + "xerces-c/src/stricmp.c", + "xerces-c/src/strnicmp.c", + "xerces-c/src/xercesc/util/NetAccessors/Socket/SocketNetAccessor.cpp", + "xerces-c/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp", + "xerces-c/src/xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp", + "xerces-c/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp", + "xerces-c/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp", + "xerces-c/src/xercesc/util/MutexManagers/StdMutexMgr.cpp", + "xerces-c/src/xercesc/util/FileManagers/PosixFileMgr.cpp", + ] + + configs = [ + ":libxerces-c_config" + ] + + deps = [ + "//third_party/icu/icu4c:shared_icuuc", + ] + + part_name = "xerces" +} + +config("samples_config") { + cflags_cc = [ + "-frtti", + "-fexceptions", + "-Wno-header-hygiene", + "-DHAVE_CONFIG_H=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-Wno-long-long", + "-Wno-variadic-macros", + "-Wno-misleading-indentation", + "-Wno-main", + "-Wno-unused-variable", + ] + + include_dirs = [ + "xerces-c/samples", + "xerces-c/src", + "xerces-c/samples/src", + "adapted", + ] +} + +ohos_executable("StdInParse") { + sources= [ + "xerces-c/samples/src/StdInParse/StdInParse.cpp", + "xerces-c/samples/src/StdInParse/StdInParseHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("SEnumVal") { + sources= [ + "xerces-c/samples/src/SEnumVal/SEnumVal.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("CreateDOMDocument") { + sources= [ + "xerces-c/samples/src/CreateDOMDocument/CreateDOMDocument.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("SCMPrint") { + sources= [ + "xerces-c/samples/src/SCMPrint/SCMPrint.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c" + ] + + part_name = "xerces" +} + +ohos_executable("XInclude") { + sources= [ + "xerces-c/samples/src/XInclude/XInclude.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("DOMCount") { + sources= [ + "xerces-c/samples/src/DOMCount/DOMCount.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("EnumVal") { + sources= [ + "xerces-c/samples/src/EnumVal/EnumVal.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("PSVIWriter") { + sources= [ + "xerces-c/samples/src/PSVIWriter/PSVIWriter.cpp", + "xerces-c/samples/src/PSVIWriter/PSVIWriterHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("MemParse") { + sources= [ + "xerces-c/samples/src/MemParse/MemParse.cpp", + "xerces-c/samples/src/MemParse/MemParseHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("DOMPrint") { + sources= [ + "xerces-c/samples/src/DOMPrint/DOMPrint.cpp", + "xerces-c/samples/src/DOMPrint/DOMPrintErrorHandler.cpp", + "xerces-c/samples/src/DOMPrint/DOMPrintFilter.cpp", + "xerces-c/samples/src/DOMPrint/DOMTreeErrorReporter.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("Redirect") { + sources= [ + "xerces-c/samples/src/Redirect/Redirect.cpp", + "xerces-c/samples/src/Redirect/RedirectHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("PParse") { + sources= [ + "xerces-c/samples/src/PParse/PParse.cpp", + "xerces-c/samples/src/PParse/PParseHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("SAXCount") { + sources= [ + "xerces-c/samples/src/SAXCount/SAXCount.cpp", + "xerces-c/samples/src/SAXCount/SAXCountHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("SAX2Print") { + sources= [ + "xerces-c/samples/src/SAX2Print/SAX2FilterHandlers.cpp", + "xerces-c/samples/src/SAX2Print/SAX2Print.cpp", + "xerces-c/samples/src/SAX2Print/SAX2PrintHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("SAX2Count") { + sources= [ + "xerces-c/samples/src/SAX2Count/SAX2Count.cpp", + "xerces-c/samples/src/SAX2Count/SAX2CountHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("SAXPrint") { + sources= [ + "xerces-c/samples/src/SAXPrint/SAXPrint.cpp", + "xerces-c/samples/src/SAXPrint/SAXPrintHandlers.cpp", + ] + + configs = [ + ":samples_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +config("tests_config") { + cflags_cc = [ + "-frtti", + "-fexceptions", + "-Wno-header-hygiene", + "-DHAVE_CONFIG_H=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-Wno-implicitly-unsigned-literal", + "-Wno-variadic-macros", + "-fstrict-aliasing", + "-Wno-misleading-indentation", + "-Wno-main", + "-Wno-unused-variable", + ] + + include_dirs = [ + "xerces-c/tests", + "xerces-c/tests/src", + "xerces-c/src", + "xerces-c", + "adapted", + ] +} + +ohos_executable("XSValueTest") { + sources= [ + "xerces-c/tests/src/XSValueTest/XSValueTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("DOMTest") { + sources= [ + "xerces-c/tests/src/DOM/DOMTest/DTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("ThreadTest") { + sources= [ + "xerces-c/tests/src/ThreadTest/ThreadTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("Char16Test") { + sources= [ + "xerces-c/tests/src/Char16Test/Char16Test.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("DOMMemTest") { + sources= [ + "xerces-c/tests/src/DOM/DOMMemTest/DOMMemTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("DOMTraversalTest") { + sources= [ + "xerces-c/tests/src/DOM/Traversal/Traversal.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("XSerializerTest") { + sources= [ + "xerces-c/tests/src/XSerializerTest/XSerializerHandlers.cpp", + "xerces-c/tests/src/XSerializerTest/XSerializerTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("RangeTest") { + sources= [ + "xerces-c/tests/src/DOM/RangeTest/RangeTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("InitTermTest") { + sources= [ + "xerces-c/tests/src/InitTermTest/InitTermTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("DOMTypeInfoTest") { + sources= [ + "xerces-c/tests/src/DOM/TypeInfo/TypeInfo.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("XSTSHarness") { + sources= [ + "xerces-c/tests/src/XSTSHarness/XSTSHarness.cpp", + "xerces-c/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp", + "xerces-c/tests/src/XSTSHarness/XMLHarnessHandlers.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("EncodingTest") { + sources= [ + "xerces-c/tests/src/EncodingTest/EncodingTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("Normalizer") { + sources= [ + "xerces-c/tests/src/DOM/Normalizer/Normalizer.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("MemHandlerTest") { + sources= [ + "xerces-c/tests/src/MemHandlerTest/MemoryMonitor.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +ohos_executable("NetAccessorTest") { + sources= [ + "xerces-c/tests/src/NetAccessorTest/NetAccessorTest.cpp", + ] + + configs = [ + ":tests_config" + ] + deps = [ + ":libxerces-c", + ] + + part_name = "xerces" +} + +group("samples") { + +if(enable_xerces_test) { + deps = [ + ":StdInParse", + ":SEnumVal", + ":CreateDOMDocument", + ":SCMPrint", + ":XInclude", + ":DOMCount", + ":EnumVal", + ":PSVIWriter", + ":MemParse", + ":DOMPrint", + ":Redirect", + ":PParse", + ":SAXCount", + ":SAX2Print", + ":SAX2Count", + ":SAXPrint", + ] +} else { + deps = [] +} +} + +group("tests") { + +if(enable_xerces_test){ + deps = [ + ":XSValueTest", + ":DOMTest", + ":ThreadTest", + ":Char16Test", + ":DOMMemTest", + ":DOMTraversalTest", + ":XSerializerTest", + ":RangeTest", + ":InitTermTest", + ":DOMTypeInfoTest", + ":XSTSHarness", + ":EncodingTest", + ":Normalizer", + ":MemHandlerTest", + ":NetAccessorTest", + ] +}else { + deps = [] +} +} diff --git a/xerces-c/README.OpenSource b/xerces-c/README.OpenSource new file mode 100755 index 0000000000000000000000000000000000000000..3475db93c0d54ecbb930873323563be896f65407 --- /dev/null +++ b/xerces-c/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "xerces-c", + "License": "Apache License V2.0", + "License File": "LICENSE", + "Version Number": "v3.2.3", + "Owner": "huangminzhong2@huawei.com", + "Upstream URL": "https://github.com/apache/xerces-c.git", + "Description": "Apache Xerces-C validating XML parser" + } +] diff --git a/xerces-c/README_zh.md b/xerces-c/README_zh.md new file mode 100755 index 0000000000000000000000000000000000000000..5709a69f51b9780aa2f2bdd635fef659dbd91f30 --- /dev/null +++ b/xerces-c/README_zh.md @@ -0,0 +1,10 @@ +# xerces-c三方库说明 +## 功能简介 +xerces是一个开放源代码的XML语法分析器,它提供了SAX和DOM API。 +## 使用约束 +- ROM版本:OpenHarmony-v3.2-Beta1 +- 三方库版本:v3.2.3 +- 当前适配的功能:支持sax解析和dom解析 +- [Apache License 2.0](https://github.com/apache/xerces-c/blob/master/LICENSE) +## 集成方式 ++ [系统Rom包集成](docs/rom_integrate.md) diff --git a/xerces-c/adapted/config.h b/xerces-c/adapted/config.h new file mode 100755 index 0000000000000000000000000000000000000000..93ff1a6b4562b25bde04765647aaaf53bbfc054f --- /dev/null +++ b/xerces-c/adapted/config.h @@ -0,0 +1,490 @@ +/* config.h.cmake.in. Not generated, but originated from autoheader. */ +/* This file must be kept up-to-date with needed substitutions from config.h.in. */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CSTDINT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +#if defined(__cplusplus) && defined(HAVE_CSTDINT) +#include +#elif HAVE_STDINT_H +#include +#elif HAVE_INTTYPES_H +#include +#endif + +/* Define to specify no threading is used */ +/* #undef APP_NO_THREADS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_COMPAT_H 1 + +/* define if bool is a built-in type */ +#define HAVE_BOOL 1 + +/* Define to 1 if you have the `catclose' function. */ +#define HAVE_CATCLOSE 1 + +/* Define to 1 if you have the `catgets' function. */ +#define HAVE_CATGETS 1 + +/* Define to 1 if you have the `catopen' function. */ +#define HAVE_CATOPEN 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have cpuid.h */ +/* #undef HAVE_CPUID_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FLOAT_H 1 + +/* Define to 1 if you have the `ftime' function. */ +#define HAVE_FTIME 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `gethostbyaddr' function. */ +#define HAVE_GETHOSTBYADDR 1 + +/* Define to 1 if you have the `gethostbyname' function. */ +#define HAVE_GETHOSTBYNAME 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the `iconv' function. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the `iconv_close' function. */ +#define HAVE_ICONV_CLOSE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ICONV_H 1 + +/* Define to 1 if you have the `iconv_open' function. */ +#define HAVE_ICONV_OPEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#define HAVE_LIBNSL 1 + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `localeconv' function. */ +#define HAVE_LOCALECONV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* define if the compiler implements L"widestring" */ +#define HAVE_LSTRING 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_ENDIAN_H */ + +/* Define to 1 if you have the `mblen' function. */ +#define HAVE_MBLEN 1 + +/* Define to 1 if you have the `mbrlen' function. */ +#define HAVE_MBRLEN 1 + +/* Define to 1 if you have the `mbsrtowcs' function. */ +#define HAVE_MBSRTOWCS 1 + +/* Define to 1 if you have the `mbstowcs' function. */ +#define HAVE_MBSTOWCS 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NL_TYPES_H 1 + +/* Define to 1 if you have the `pathconf' function. */ +#define HAVE_PATHCONF 1 + +/* Define to 1 if you have the PATH_MAX macro. */ +#define HAVE_PATH_MAX 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the `realpath' function. */ +#define HAVE_REALPATH 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +/* #undef HAVE_STDBOOL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* define if the compiler supports ISO C++ standard library */ +#define HAVE_STD_LIBS 1 + +/* define if the compiler supports the std namespace */ +#define HAVE_STD_NAMESPACE 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `stricmp' function. */ +/* #undef HAVE_STRICMP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strnicmp' function. */ +/* #undef HAVE_STRNICMP */ + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strstr' function. */ +#define HAVE_STRSTR 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIMEB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `timegm' function. */ +#define HAVE_TIMEGM 1 + +/* Define to 1 if you have the `towlower' function. */ +#define HAVE_TOWLOWER 1 + +/* Define to 1 if you have the `towupper' function. */ +#define HAVE_TOWUPPER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wcsicmp' function. */ +/* #undef HAVE_WCSICMP */ + +/* Define to 1 if you have the `wcslwr' function. */ +/* #undef HAVE_WCSLWR */ + +/* Define to 1 if you have the `wcsnicmp' function. */ +/* #undef HAVE_WCSNICMP */ + +/* Define to 1 if you have the `wcsrtombs' function. */ +#define HAVE_WCSRTOMBS 1 + +/* Define to 1 if you have the `wcstombs' function. */ +#define HAVE_WCSTOMBS 1 + +/* Define to 1 if you have the `wcsupr' function. */ +/* #undef HAVE_WCSUPR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINSOCK2_H */ + +/* Define to 1 if you have to use const char* with iconv, to 0 if you must use + char*. */ +#define ICONV_USES_CONST_POINTER 0 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "xerces-c" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "xerces-c" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "xerces-c 3.2.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "xerces-c" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.2.3" + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `wchar_t', as computed by sizeof. */ +#define SIZEOF_WCHAR_T 4 + +/* The size of `__int64', as computed by sizeof. */ +#define SIZEOF___INT64 0 + +/* Version number of package */ +#define VERSION "3.2.3" + +/* Define if DLL symbols should be exported */ +/* #undef XERCES_DLL_EXPORT */ + +/* Define if namespaces is supported by the compiler */ +#define XERCES_HAS_CPP_NAMESPACE 1 + +/* Define to have SSE2 instruction support detected at runtime using __cpuid + */ +/* #undef XERCES_HAVE_CPUID_INTRINSIC */ + +/* Define to 1 if you have emmintrin.h */ +/* #undef XERCES_HAVE_EMMINTRIN_H */ + +/* Define to have SSE2 instruction support detected at runtime using + __get_cpuid */ +/* #undef XERCES_HAVE_GETCPUID */ + +/* Define to 1 if you have intrin.h */ +/* #undef XERCES_HAVE_INTRIN_H */ + +/* Define to 1 if we have inttypes.h */ +#define XERCES_HAVE_INTTYPES_H 1 + +/* Define to have SSE2 instruction used at runtime */ +/* #undef XERCES_HAVE_SSE2_INTRINSIC */ + +/* Define to 1 if we have sys/types.h */ +#define XERCES_HAVE_SYS_TYPES_H 1 + +/* Define to have Xerces_autoconf_config.hpp include wchar.h */ +/* #undef XERCES_INCLUDE_WCHAR_H */ + +/* Define if there is support for L"widestring" */ +#define XERCES_LSTRSUPPORT 1 + +/* Define if the isstream library can be included as */ +#define XERCES_NEW_IOSTREAMS 1 + +/* Define to have XMemory.hpp avoid declaring a matching operator delete for + the placement operator new */ +/* #undef XERCES_NO_MATCHING_DELETE_OPERATOR */ + +/* Define if there is no native bool support in this environment */ +/* #undef XERCES_NO_NATIVE_BOOL */ + +/* Define to use backslash as an extra path delimiter character */ +/* #undef XERCES_PATH_DELIMITER_BACKSLASH */ + +/* Define as the platform's export attribute */ +#define XERCES_PLATFORM_EXPORT + +/* Define as the platform's import attribute */ +#define XERCES_PLATFORM_IMPORT + +/* An appropriate signed 16 bit integer type */ +#define XERCES_S16BIT_INT int16_t + +/* An appropriate signed 32 bit integer type */ +#define XERCES_S32BIT_INT int32_t + +/* An appropriate signed 64 bit integer type */ +#define XERCES_S64BIT_INT int64_t + +/* Define as the appropriate SIZE_MAX macro */ +#define XERCES_SIZE_MAX SIZE_MAX + +/* Define as the appropriate size_t type */ +#define XERCES_SIZE_T size_t + +/* Define as the appropriate SSIZE_MAX macro */ +#define XERCES_SSIZE_MAX SSIZE_MAX + +/* Define as the appropriate ssize_t type */ +#define XERCES_SSIZE_T ssize_t + +/* Define if building a static library */ +/* #undef XERCES_STATIC_LIBRARY */ + +/* Define if the std namespace is supported */ +#define XERCES_STD_NAMESPACE 1 + +/* An appropriate unsigned 16 bit integer type */ +#define XERCES_U16BIT_INT uint16_t + +/* An appropriate unsigned 32 bit integer type */ +#define XERCES_U32BIT_INT uint32_t + +/* An appropriate unsigned 64 bit integer type */ +#define XERCES_U64BIT_INT uint64_t + +/* Define to use the POSIX file mgr */ +#define XERCES_USE_FILEMGR_POSIX 1 + +/* Define to use the Windows file mgr */ +/* #undef XERCES_USE_FILEMGR_WINDOWS */ + +/* Define to use the iconv-based MsgLoader */ +/* #undef XERCES_USE_MSGLOADER_ICONV */ + +/* Define to use the ICU-based MsgLoader */ +/* #undef XERCES_USE_MSGLOADER_ICU */ + +/* Define to use the InMemory MsgLoader */ +#define XERCES_USE_MSGLOADER_INMEMORY 1 + +/* Define to use the NoThread mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_NOTHREAD */ + +/* Define to use the C++11 standard mutex mgr */ +#define XERCES_USE_MUTEXMGR_STD 1 + +/* Define to use the POSIX mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_POSIX */ + +/* Define to use the Windows mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_WINDOWS */ + +/* Define to use the Mac OS X CFURL NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_CFURL */ + +/* Define to use the CURL NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_CURL */ + +/* Define to use the Sockets-based NetAccessor */ +#define XERCES_USE_NETACCESSOR_SOCKET 1 + +/* Define to use the WinSock NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_WINSOCK */ + +/* Define to use the GNU iconv transcoder */ +/* #undef XERCES_USE_TRANSCODER_GNUICONV */ + +/* Define to use the iconv transcoder */ +/* #undef XERCES_USE_TRANSCODER_ICONV */ + +/* Define to use the ICU-based transcoder */ +/*#define XERCES_USE_TRANSCODER_ICU 1*/ + +/* Define to use the Mac OS UnicodeConverter-based transcoder */ +/* #undef XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER */ + +/* Define to use the Windows transcoder */ +/* #undef XERCES_USE_TRANSCODER_WINDOWS */ + +/* Define to the 16 bit type used to represent Xerces UTF-16 characters */ +#define XERCES_XMLCH_T char16_t + + diff --git a/xerces-c/adapted/xercesc/util/XercesVersion.hpp b/xerces-c/adapted/xercesc/util/XercesVersion.hpp new file mode 100755 index 0000000000000000000000000000000000000000..7cf165b8389a1e9cd51fed22bc7714ee832d96ae --- /dev/null +++ b/xerces-c/adapted/xercesc/util/XercesVersion.hpp @@ -0,0 +1,219 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id$ + */ + +#if !defined(XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP) +#define XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP + +// --------------------------------------------------------------------------- +// X E R C E S V E R S I O N H E A D E R D O C U M E N T A T I O N + +/** + * User Documentation for Xerces Version Values: + * + * + * + * Xerces Notes: + * + * Xerces Committers Documentation: + * + * Xerces committers normally only need to modify one or two of the + * following macros: + * + * XERCES_VERSION_MAJOR + * XERCES_VERSION_MINOR + * XERCES_VERSION_REVISION + * + * The integer values of these macros define the Xerces version number. All + * other constants and preprocessor macros are automatically generated from + * these three definitions. + * + * The macro XERCES_GRAMMAR_SERIALIZATION_LEVEL has been added so that during + * development if users are using the latest code they can use the grammar + * serialization/deserialization features. Whenever a change is made to the + * serialization code this macro should be incremented. + * + * Xerces User Documentation: + * + * The following sections in the user documentation have examples based upon + * the following three version input values: + * + * #define XERCES_VERSION_MAJOR 19 + * #define XERCES_VERSION_MINOR 3 + * #define XERCES_VERSION_REVISION 74 + * + * The minor and revision (patch level) numbers have two digits of resolution + * which means that '3' becomes '03' in this example. This policy guarantees + * that when using preprocessor macros, version 19.3.74 will be greater than + * version 1.94.74 since the first will expand to 190374 and the second to + * 19474. + * + * Preprocessor Macros: + * + * _XERCES_VERSION defines the primary preprocessor macro that users will + * introduce into their code to perform conditional compilation where the + * version of Xerces is detected in order to enable or disable version + * specific capabilities. The value of _XERCES_VERSION for the above example + * will be 190374. To use it a user would perform an operation such as the + * following: + * + * #if _XERCES_VERSION >= 190374 + * // code specific to new version of Xerces... + * #else + * // old code here... + * #endif + * + * XERCES_FULLVERSIONSTR is a preprocessor macro that expands to a string + * constant whose value, for the above example, will be "19_3_74". + * + * XERCES_FULLVERSIONDOT is a preprocessor macro that expands to a string + * constant whose value, for the above example, will be "19.3.74". + * + * XERCES_VERSIONSTR is a preprocessor macro that expands to a string + * constant whose value, for the above example, will be "19_3". This + * particular macro is very dangerous if it were to be used for comparing + * version numbers since ordering will not be guaranteed. + * + * Xerces_DLLVersionStr is a preprocessor macro that expands to a string + * constant whose value, for the above example, will be "19_3_74". This + * macro is provided for backwards compatibility to pre-1.7 versions of + * Xerces. + * + * String Constants: + * + * gXercesVersionStr is a global string constant whose value corresponds to + * the value "19_3" for the above example. + * + * gXercesFullVersionStr is a global string constant whose value corresponds + * to the value "19_3_74" for the above example. + * + * Numeric Constants: + * + * gXercesMajVersion is a global integer constant whose value corresponds to + * the major version number. For the above example its value will be 19. + * + * gXercesMinVersion is a global integer constant whose value corresponds to + * the minor version number. For the above example its value will be 3. + * + * gXercesRevision is a global integer constant whose value corresponds to + * the revision (patch) version number. For the above example its value will + * be 74. + * + */ + +// --------------------------------------------------------------------------- +// X E R C E S V E R S I O N S P E C I F I C A T I O N + +/** + * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH XERCES VERSION + * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE + */ + +#define XERCES_VERSION_MAJOR 3 +#define XERCES_VERSION_MINOR 2 +#define XERCES_VERSION_REVISION 3 + +/*** + * + * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 4 SchemaAttDef, SchemaElementDecl serialize fPSVIScope + * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 5 XercesStep serializes the axis as an int + * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 6 added fIsExternal to XMLEntityDecl + * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 7 size of line/column fields has changed + * + ***/ +#define XERCES_GRAMMAR_SERIALIZATION_LEVEL 7 + +/** DO NOT MODIFY BELOW THIS LINE */ + +/** + * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING: + * + * Xerces_DLLVersionStr, gXercesVersionStr, gXercesFullVersionStr, + * gXercesMajVersion, gXercesMinVersion, gXercesRevision + */ + +// --------------------------------------------------------------------------- +// T W O A R G U M E N T C O N C A T E N A T I O N M A C R O S + +// two argument concatenation routines +#define CAT2_SEP_UNDERSCORE(a, b) #a "_" #b +#define CAT2_SEP_PERIOD(a, b) #a "." #b +#define CAT2_SEP_NIL(a, b) #a #b +#define CAT2_RAW_NUMERIC(a, b) a ## b + +// two argument macro invokers +#define INVK_CAT2_SEP_UNDERSCORE(a,b) CAT2_SEP_UNDERSCORE(a,b) +#define INVK_CAT2_SEP_PERIOD(a,b) CAT2_SEP_PERIOD(a,b) +#define INVK_CAT2_STR_SEP_NIL(a,b) CAT2_SEP_NIL(a,b) +#define INVK_CAT2_RAW_NUMERIC(a,b) CAT2_RAW_NUMERIC(a,b) + +// --------------------------------------------------------------------------- +// T H R E E A R G U M E N T C O N C A T E N A T I O N M A C R O S + +// three argument concatenation routines +#define CAT3_SEP_UNDERSCORE(a, b, c) #a "_" #b "_" #c +#define CAT3_SEP_PERIOD(a, b, c) #a "." #b "." #c +#define CAT3_SEP_NIL(a, b, c) #a #b #c +#define CAT3_RAW_NUMERIC(a, b, c) a ## b ## c +#define CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a, b, c) a ## _ ## b ## _ ## c + +// three argument macro invokers +#define INVK_CAT3_SEP_UNDERSCORE(a,b,c) CAT3_SEP_UNDERSCORE(a,b,c) +#define INVK_CAT3_SEP_PERIOD(a,b,c) CAT3_SEP_PERIOD(a,b,c) +#define INVK_CAT3_SEP_NIL(a,b,c) CAT3_SEP_NIL(a,b,c) +#define INVK_CAT3_RAW_NUMERIC(a,b,c) CAT3_RAW_NUMERIC(a,b,c) +#define INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c) CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c) + +// --------------------------------------------------------------------------- +// C A L C U L A T E V E R S I O N - E X P A N D E D F O R M + +#define MULTIPLY(factor,value) factor * value +#define CALC_EXPANDED_FORM(a,b,c) ( MULTIPLY(10000,a) + MULTIPLY(100,b) + MULTIPLY(1,c) ) + +// --------------------------------------------------------------------------- +// X E R C E S V E R S I O N I N F O R M A T I O N + +// Xerces version strings; these particular macros cannot be used for +// conditional compilation as they are not numeric constants + +#define XERCES_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) +#define XERCES_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) +#define XERCES_FULLVERSIONNUM INVK_CAT3_SEP_NIL(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) +#define XERCES_VERSIONSTR INVK_CAT2_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR) + +// Xerces C++ Namespace string, concatenated with full version string +#define XERCES_PRODUCT xercesc +#define XERCES_CPP_NAMESPACE INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(XERCES_PRODUCT,XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR) + +// original from Xerces header +#define Xerces_DLLVersionStr XERCES_FULLVERSIONSTR + +const char* const gXercesVersionStr = XERCES_VERSIONSTR; +const char* const gXercesFullVersionStr = XERCES_FULLVERSIONSTR; +const unsigned int gXercesMajVersion = XERCES_VERSION_MAJOR; +const unsigned int gXercesMinVersion = XERCES_VERSION_MINOR; +const unsigned int gXercesRevision = XERCES_VERSION_REVISION; + +// Xerces version numeric constants that can be used for conditional +// compilation purposes. + +#define _XERCES_VERSION CALC_EXPANDED_FORM (XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) + +#endif // XERCESVERSION_HPP diff --git a/xerces-c/adapted/xercesc/util/Xerces_autoconf_config.hpp b/xerces-c/adapted/xercesc/util/Xerces_autoconf_config.hpp new file mode 100755 index 0000000000000000000000000000000000000000..9769f725d08637fb8f26fc20b7d736f0ab844c32 --- /dev/null +++ b/xerces-c/adapted/xercesc/util/Xerces_autoconf_config.hpp @@ -0,0 +1,156 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id: Xerces_autoconf_config.hpp.in 834826 2009-11-11 10:03:53Z borisk $ + */ + +// +// There are two primary xerces configuration header files: +// +// Xerces_autoconf_config.hpp +// +// For configuration of items that must be accessable +// through public headers. This file has limited information +// and carefully works to avoid collision of macro names, etc. +// +// This file is included by XercesDefs.h. In the event +// of a non-configured platform, a similar header specific +// to the platform will be included instead. +// +// config.h +// +// Generalized cmake-generated header file, with much more +// information, used to supply configuration information +// for use in implementation files. +// +// For CMake-based builds, this header is configured by cmake from the +// .cmake.in template file of the same name. + + +#ifndef XERCES_AUTOCONFIG_CONFIG_HPP +#define XERCES_AUTOCONFIG_CONFIG_HPP + +// --------------------------------------------------------------------------- +// These defines are set by cmake as appropriate for the platform. +// --------------------------------------------------------------------------- +#define XERCES_AUTOCONF 1 +#define XERCES_HAVE_SYS_TYPES_H 1 +#define XERCES_HAVE_CSTDINT 1 +#define XERCES_HAVE_STDINT_H 1 +#define XERCES_HAVE_INTTYPES_H 1 +/* #undef XERCES_HAVE_INTRIN_H */ +/* #undef XERCES_HAVE_EMMINTRIN_H */ +/* #undef XERCES_INCLUDE_WCHAR_H */ + +#define XERCES_S16BIT_INT int16_t +#define XERCES_S32BIT_INT int32_t +#define XERCES_S64BIT_INT int64_t +#define XERCES_U16BIT_INT uint16_t +#define XERCES_U32BIT_INT uint32_t +#define XERCES_U64BIT_INT uint64_t +#define XERCES_XMLCH_T char16_t +#define XERCES_SIZE_T size_t +#define XERCES_SSIZE_T ssize_t + +#define XERCES_HAS_CPP_NAMESPACE 1 +#define XERCES_STD_NAMESPACE 1 +#define XERCES_NEW_IOSTREAMS 1 +/* #undef XERCES_NO_NATIVE_BOOL */ +#define XERCES_LSTRSUPPORT 1 +/* #undef XERCES_MFC_SUPPORT */ + +/* #undef XERCES_HAVE_CPUID_INTRINSIC */ +/* #undef XERCES_HAVE_SSE2_INTRINSIC */ +/* #undef XERCES_HAVE_GETCPUID */ + +/* #undef XERCES_NO_MATCHING_DELETE_OPERATOR */ + +/* #undef XERCES_DLL_EXPORT */ +/* #undef XERCES_STATIC_LIBRARY */ +#define XERCES_PLATFORM_EXPORT +#define XERCES_PLATFORM_IMPORT +#define XERCES_TEMPLATE_EXTERN extern +#ifdef XERCES_DLL_EXPORT +# define DLL_EXPORT +#endif + +// --------------------------------------------------------------------------- +// Include standard headers, if available, that we may rely on below. +// --------------------------------------------------------------------------- +#if defined(__cplusplus) && defined(XERCES_HAVE_CSTDINT) +# include +#endif +#if XERCES_HAVE_STDINT_H +# include +#endif +#if XERCES_HAVE_INTTYPES_H +# include +#endif +#if XERCES_HAVE_SYS_TYPES_H +# include +#endif +#if XERCES_INCLUDE_WCHAR_H +# include +#endif + +// --------------------------------------------------------------------------- +// XMLSize_t is the unsigned integral type. +// --------------------------------------------------------------------------- +typedef XERCES_SIZE_T XMLSize_t; +typedef XERCES_SSIZE_T XMLSSize_t; + +#define XERCES_SIZE_MAX SIZE_MAX +#define XERCES_SSIZE_MAX SSIZE_MAX + +// --------------------------------------------------------------------------- +// Define our version of the XML character +// --------------------------------------------------------------------------- +typedef XERCES_XMLCH_T XMLCh; + +// --------------------------------------------------------------------------- +// Define unsigned 16, 32, and 64 bit integers +// --------------------------------------------------------------------------- +typedef XERCES_U16BIT_INT XMLUInt16; +typedef XERCES_U32BIT_INT XMLUInt32; +typedef XERCES_U64BIT_INT XMLUInt64; + +// --------------------------------------------------------------------------- +// Define signed 16, 32, and 64 bit integers +// --------------------------------------------------------------------------- +typedef XERCES_S16BIT_INT XMLInt16; +typedef XERCES_S32BIT_INT XMLInt32; +typedef XERCES_S64BIT_INT XMLInt64; + +// --------------------------------------------------------------------------- +// XMLFilePos is the type used to represent a file position. +// --------------------------------------------------------------------------- +typedef XMLUInt64 XMLFilePos; + +// --------------------------------------------------------------------------- +// XMLFileLoc is the type used to represent a file location (line/column). +// --------------------------------------------------------------------------- +typedef XMLUInt64 XMLFileLoc; + +// --------------------------------------------------------------------------- +// Force on the Xerces debug token if it is on in the build environment +// --------------------------------------------------------------------------- +#if defined(_DEBUG) +#define XERCES_DEBUG +#endif + +#endif diff --git a/xerces-c/bundle.json b/xerces-c/bundle.json new file mode 100755 index 0000000000000000000000000000000000000000..0c849472fb48a9b89d8f217c8399ff0fe613cd38 --- /dev/null +++ b/xerces-c/bundle.json @@ -0,0 +1,33 @@ +{ + "name": "@ohos/xerces-c", + "description": "Apache Xerces-C validating XML parser", + "version": "v3.2.3", + "license": "Apache License V2.0", + "publishAs": "", + "segment": { + "destPath": "third_party/xerces-c" + }, + "dirs": {}, + "scripts": {}, + "readmePath": { + "en": "README" + }, + "component": { + "name": "xerces", + "subsystem": "thirdparty", + "syscap": [], + "features": [], + "adapted_system_type": ["standard"], + "rom": "", + "ram": "", + "deps": { + "components": [], + "third_party": [] + }, + "build": { + "sub_component": ["//third_party/xerces-c:libxerces-c","//third_party/xerces-c:samples","//third_party/xerces-c:tests"], + "inner_kits": [], + "test": [] + } + } +} diff --git a/xerces-c/docs/pic/result.png b/xerces-c/docs/pic/result.png new file mode 100755 index 0000000000000000000000000000000000000000..f11a5572536bdc9e88de6399dd20eddc113bf692 Binary files /dev/null and b/xerces-c/docs/pic/result.png differ diff --git a/xerces-c/docs/rom_integrate.md b/xerces-c/docs/rom_integrate.md new file mode 100755 index 0000000000000000000000000000000000000000..da79bbb5f35a2d9efcbf9b741ea22d16d797deff --- /dev/null +++ b/xerces-c/docs/rom_integrate.md @@ -0,0 +1,111 @@ +# xerces-c如何集成到系统Rom +## 准备源码工程 +本库是基于OpenHarmony-v3.2-Beta1版本,在RK3568开发板上验证的,如果是从未使用过RK3568,可以先查看[润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld)。 +### 准备系统Rom源码 +系统源码获取请参考:[OpenHarmony源码下载](https://gitee.com/openharmony/docs/blob/OpenHarmony-v3.2-Beta2/zh-cn/release-notes/OpenHarmony-v3.2-beta1.md) +### 增加构建脚本及配置文件 +- 下载本仓库代码 + ``` + cd ~ + git clone git@gitee.com:openharmony-sig/tpc_c_cplusplus.git --depth=1 + ``` +- 三方库目录结构 + ``` + tpc_c_cplusplus/xerces-c #三方库xerces-c的目录结构如下 + ├── adapted #存放三方库适配需要的代码文件 + ├── docs #存放三方库相关文档的文件夹 + ├── BUILD.gn #构建脚本,支持rom包集成 + ├── bundle.json #三方库组件定义文件 + ├── README.OpenSource #说明三方库源码的下载地址,版本,license等信息 + ├── README_zh.md + ``` +- 将三方库拷贝到OpenHarmony源码的third_party目录下 + ``` + cp ~/tpc_c_cplusplus/xerces-c ~/openharmony/third_party -rf + ``` +### 准备三方库源码 +``` +cd ~/openharmony/third_party/xerces-c #进入三方库目录 +git clone https://github.com/apache/xerces-c.git -b v3.2.3 #下载三方库源码 +``` +## 系统Rom中引入三方库 +准备完三方库代码后,我们需要将三方库加入到编译构建体系中。标准系统编译构建可以参考文档[标准系统编译构建指导](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Beta1/zh-cn/device-dev/subsystems/subsys-build-standard-large.md) +我们默认三方库是属于OpenHarmony的thirdparty子系统,如果需要自己定义子系统参考文档[如何为三方库组件中添加一个三方库](https://gitee.com/openharmony-sig/knowledge/blob/master/docs/openharmony_getstarted/port_thirdparty/README.md) +新增需要编译的组件,在OpenHarmony源码的vendor/hihope/rk3568/config.json文件中,新增需要编译的组件,如下代码段所示,在thirdparty子系统下面新增xerces组件 + +``` + { + "subsystem": "thirdparty", + "components": [ + { + "component": "musl", + "features": [] + }, + { + "component": "xerces", + "features": [] + } + ] + } + +``` +## 系统Rom中引入三方库测试程序 +如果需要编译测试用例,在OpenHarmony源码的vendor/hihope/rk3568/config.json文件,对应组件的features中打开编译选项,如下 +``` + { + "subsystem": "thirdparty", + "components": [ + { + "component": "musl", + "features": [] + }, + { + "component": "xerces", + "features": ["enable_xerces_test=true"] + } + ] + } +``` +## 编译工程 +在OpenHarmony源码根目录下 +``` +cd ~/openharmony +``` +- 选择平台 + ``` + hb set #hb set 命令会列出所有可选平台,这里我们选择rk3568 + ``` +- 执行编译 + ``` + hb build --target-cpu arm #编译32位系统 + hb build --target-cpu arm64 #编译64位系统 + ``` +- 生成文件的路径,可执行文件和库文件都在out/rk3568/thirdparty/xerces目录下,同时也打包到了镜像中 +## 运行效果 +将编译生成的库和测试文件放到板子上运行,为避免每次将文件推入设备都烧录整个镜像,我们使用hdc_std工具将文件推到开发板上 +- 首先将hdc_std工具编译出来 + 工具编译出来所在路径out/sdk/ohos-sdk/windows/toolchains/hdc_std.exe + + ``` + hb set #源码根目录下使用hb set 选择产品ohos-sdk + hb build #然后编译 + ``` +- 将工具拷贝到Windows,可以为工具目录配置环境变量,也可以在工具所在目录打开windows命令行 +- 将原生库测试需要的所有文件打包成xerces.tar,并拷贝到windows下 +- 将文件推送到开发板,在windows命令行进行如下操作 + ``` + hdc_std shell mount -oremount,rw / #修改系统权限为可读写 + hdc_std file send xerces.tar / #将文件包推入开发板 + hdc_std shell #进入开发板 + tar xvf xerces.tar #解压 + #注意需要将库拷贝到/system/lib 或者/system/lib64目录下 + ``` +- 运行测试程序 + 测试用例非常多,这里演示其中几个用例,如下图 + ![result](pic/result.png) +## 参考资料 +- [润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld) +- [OpenHarmony三方库地址](https://gitee.com/openharmony-tpc) +- [OpenHarmony知识体系](https://gitee.com/openharmony-sig/knowledge) +- [如何为三方库组件中添加一个三方库](https://gitee.com/openharmony-sig/knowledge/blob/master/docs/openharmony_getstarted/port_thirdparty/README.md) +- [标准系统编译构建指导](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Beta1/zh-cn/device-dev/subsystems/subsys-build-standard-large.md) \ No newline at end of file