From bcd21ceee8f119d5f188c8a09c0779b2077c23ad Mon Sep 17 00:00:00 2001 From: PeiYong Zhang <peiyongz@apache.org> Date: Tue, 6 Jan 2004 18:13:59 +0000 Subject: [PATCH] using the no-exception-thrown ctor git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175651 13f79535-47bb-0310-9956-ffa450edef68 --- .../validators/datatype/AbstractStringValidator.cpp | 7 ++++++- .../validators/datatype/BooleanDatatypeValidator.cpp | 7 ++++++- src/xercesc/validators/datatype/DateTimeValidator.cpp | 7 ++++++- .../validators/datatype/DecimalDatatypeValidator.cpp | 7 ++++++- .../validators/datatype/DoubleDatatypeValidator.cpp | 7 ++++++- src/xercesc/validators/datatype/FloatDatatypeValidator.cpp | 7 ++++++- src/xercesc/validators/datatype/ListDatatypeValidator.cpp | 7 ++++++- src/xercesc/validators/datatype/UnionDatatypeValidator.cpp | 7 ++++++- 8 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/xercesc/validators/datatype/AbstractStringValidator.cpp b/src/xercesc/validators/datatype/AbstractStringValidator.cpp index 5d70e55a3..88c5ed91f 100644 --- a/src/xercesc/validators/datatype/AbstractStringValidator.cpp +++ b/src/xercesc/validators/datatype/AbstractStringValidator.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.19 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.18 2003/12/31 10:38:00 amassari * Made virtual function checkAdditionalFacet 'const', so that it matches the declaration in a derived class * @@ -692,7 +695,9 @@ void AbstractStringValidator::checkContent( const XMLCh* const conte if (getRegex() ==0) { try { // REVISIT: cargillmem fMemoryManager or manager? - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { diff --git a/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp b/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp index 76687e882..7875f1a56 100644 --- a/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp +++ b/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.14 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.13 2003/12/23 21:50:36 peiyongz * Absorb exception thrown in getCanonicalRepresentation and return 0, * only validate when required @@ -208,7 +211,9 @@ void BooleanDatatypeValidator::checkContent( const XMLCh* const cont // lazy construction if (getRegex() ==0) { try { - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { diff --git a/src/xercesc/validators/datatype/DateTimeValidator.cpp b/src/xercesc/validators/datatype/DateTimeValidator.cpp index 3e0725f94..00617c059 100644 --- a/src/xercesc/validators/datatype/DateTimeValidator.cpp +++ b/src/xercesc/validators/datatype/DateTimeValidator.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.14 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.13 2003/12/19 23:02:25 cargilld * More memory management updates. * @@ -198,7 +201,9 @@ void DateTimeValidator::checkContent(const XMLCh* const content // lazy construction if (getRegex() ==0) { try { - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { diff --git a/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp b/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp index 0a434c0d1..c43a09fca 100644 --- a/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp +++ b/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.24 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.23 2004/01/06 04:42:53 neilg * On some platforms, it is problematic to throw a different exception from inside the catch block of another exception * @@ -565,7 +568,9 @@ void DecimalDatatypeValidator::checkContent(const XMLCh* const conte if (getRegex() ==0) { try { // REVISIT: cargillmem fMemoryManager vs manager - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { diff --git a/src/xercesc/validators/datatype/DoubleDatatypeValidator.cpp b/src/xercesc/validators/datatype/DoubleDatatypeValidator.cpp index 88a747072..5720b807a 100644 --- a/src/xercesc/validators/datatype/DoubleDatatypeValidator.cpp +++ b/src/xercesc/validators/datatype/DoubleDatatypeValidator.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.12 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.11 2004/01/03 00:04:36 peiyongz * using ctor/parseContent to avoid exception thrown from ctor * @@ -288,7 +291,9 @@ void DoubleDatatypeValidator::checkContent(const XMLCh* const conten // lazy construction if (getRegex() ==0) { try { - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { diff --git a/src/xercesc/validators/datatype/FloatDatatypeValidator.cpp b/src/xercesc/validators/datatype/FloatDatatypeValidator.cpp index 209691eff..387d7c8e9 100644 --- a/src/xercesc/validators/datatype/FloatDatatypeValidator.cpp +++ b/src/xercesc/validators/datatype/FloatDatatypeValidator.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.13 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.12 2004/01/03 00:04:36 peiyongz * using ctor/parseContent to avoid exception thrown from ctor * @@ -292,7 +295,9 @@ void FloatDatatypeValidator::checkContent(const XMLCh* const content // lazy construction if (getRegex() ==0) { try { - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { diff --git a/src/xercesc/validators/datatype/ListDatatypeValidator.cpp b/src/xercesc/validators/datatype/ListDatatypeValidator.cpp index 0838f52c6..7739a5031 100644 --- a/src/xercesc/validators/datatype/ListDatatypeValidator.cpp +++ b/src/xercesc/validators/datatype/ListDatatypeValidator.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.19 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.18 2003/12/31 02:34:41 neilg * fix one more buffer overrun, affecting boolean lists * @@ -279,7 +282,9 @@ void ListDatatypeValidator::checkContent( BaseRefVectorOf<XMLCh>* to if (getRegex() == 0) { try { - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { diff --git a/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp b/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp index fb87977cd..f55ebe84e 100644 --- a/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp +++ b/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.23 2004/01/06 18:13:59 peiyongz + * using the no-exception-thrown ctor + * * Revision 1.22 2003/12/23 21:50:36 peiyongz * Absorb exception thrown in getCanonicalRepresentation and return 0, * only validate when required @@ -407,7 +410,9 @@ void UnionDatatypeValidator::checkContent(const XMLCh* const content if (getRegex() == 0) { try { - setRegex(new (fMemoryManager) RegularExpression(getPattern(), SchemaSymbols::fgRegEx_XOption, fMemoryManager)); + RegularExpression* regEx = new (fMemoryManager) RegularExpression(fMemoryManager); + regEx->setPattern(getPattern(), SchemaSymbols::fgRegEx_XOption); + setRegex(regEx); } catch (XMLException &e) { -- GitLab