You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2001/08/16 16:41:39 UTC
cvs commit: xml-xerces/c/src/validators/datatype UnionDatatypeValidator.hpp ListDatatypeValidator.hpp DatatypeValidator.hpp
knoaman 01/08/16 07:41:39
Modified: c/src/validators/datatype UnionDatatypeValidator.hpp
ListDatatypeValidator.hpp DatatypeValidator.hpp
Log:
implementation of virtual methods.
Revision Changes Path
1.3 +50 -1 xml-xerces/c/src/validators/datatype/UnionDatatypeValidator.hpp
Index: UnionDatatypeValidator.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/datatype/UnionDatatypeValidator.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UnionDatatypeValidator.hpp 2001/07/24 21:23:40 1.2
+++ UnionDatatypeValidator.hpp 2001/08/16 14:41:38 1.3
@@ -55,8 +55,11 @@
*/
/*
- * $Id: UnionDatatypeValidator.hpp,v 1.2 2001/07/24 21:23:40 tng Exp $
+ * $Id: UnionDatatypeValidator.hpp,v 1.3 2001/08/16 14:41:38 knoaman Exp $
* $Log: UnionDatatypeValidator.hpp,v $
+ * Revision 1.3 2001/08/16 14:41:38 knoaman
+ * implementation of virtual methods.
+ *
* Revision 1.2 2001/07/24 21:23:40 tng
* Schema: Use DatatypeValidator for ID/IDREF/ENTITY/ENTITIES/NOTATION.
*
@@ -115,6 +118,10 @@
// -----------------------------------------------------------------------
/** @name Getter Functions */
//@{
+ /**
+ * Returns whether the type is atomic or not
+ */
+ virtual bool isAtomic() const;
//@}
@@ -134,6 +141,17 @@
void validate(const XMLCh* const content);
+ /**
+ * Checks whether a given type can be used as a substitute
+ *
+ * @param toCheck A datatype validator of the type to be used as a
+ * substitute
+ *
+ * To be redefined in UnionDatatypeValidator
+ */
+
+ virtual bool isSubstitutableBy(const DatatypeValidator* const toCheck);
+
//@}
// -----------------------------------------------------------------------
@@ -265,6 +283,37 @@
return thisdv->fMemberTypeValidators;
}
+
+inline bool UnionDatatypeValidator::isAtomic() const {
+
+ unsigned int memberSize = fMemberTypeValidators->size();
+
+ for (unsigned int i=0; i < memberSize; i++) {
+ if (!fMemberTypeValidators->elementAt(i)->isAtomic()) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+inline bool UnionDatatypeValidator::isSubstitutableBy(const DatatypeValidator* const toCheck) {
+
+ if (toCheck == this) {
+ return true;
+ }
+
+ unsigned int memberSize = fMemberTypeValidators->size();
+
+ for (unsigned int i=0; i < memberSize; i++) {
+ if (fMemberTypeValidators->elementAt(i)->isSubstitutableBy(toCheck)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
/**
* End of file UnionDatatypeValidator.hpp
*/
1.3 +12 -2 xml-xerces/c/src/validators/datatype/ListDatatypeValidator.hpp
Index: ListDatatypeValidator.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/datatype/ListDatatypeValidator.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ListDatatypeValidator.hpp 2001/07/24 21:23:40 1.2
+++ ListDatatypeValidator.hpp 2001/08/16 14:41:38 1.3
@@ -55,8 +55,11 @@
*/
/*
- * $Id: ListDatatypeValidator.hpp,v 1.2 2001/07/24 21:23:40 tng Exp $
+ * $Id: ListDatatypeValidator.hpp,v 1.3 2001/08/16 14:41:38 knoaman Exp $
* $Log: ListDatatypeValidator.hpp,v $
+ * Revision 1.3 2001/08/16 14:41:38 knoaman
+ * implementation of virtual methods.
+ *
* Revision 1.2 2001/07/24 21:23:40 tng
* Schema: Use DatatypeValidator for ID/IDREF/ENTITY/ENTITIES/NOTATION.
*
@@ -98,7 +101,10 @@
// -----------------------------------------------------------------------
/** @name Getter Functions */
//@{
-
+ /**
+ * Returns whether the type is atomic or not
+ */
+ virtual bool isAtomic() const;
//@}
// -----------------------------------------------------------------------
@@ -294,6 +300,10 @@
bdv = bdv->getBaseValidator();
return bdv;
+}
+
+inline bool ListDatatypeValidator::isAtomic() const {
+ return false;
}
// -----------------------------------------------------------------------
1.12 +2 -2 xml-xerces/c/src/validators/datatype/DatatypeValidator.hpp
Index: DatatypeValidator.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/datatype/DatatypeValidator.hpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DatatypeValidator.hpp 2001/07/12 15:32:53 1.11
+++ DatatypeValidator.hpp 2001/08/16 14:41:38 1.12
@@ -55,7 +55,7 @@
*/
/*
- * $Id: DatatypeValidator.hpp,v 1.11 2001/07/12 15:32:53 knoaman Exp $
+ * $Id: DatatypeValidator.hpp,v 1.12 2001/08/16 14:41:38 knoaman Exp $
*/
#if !defined(DATATYPEVALIDATOR_HPP)
@@ -216,7 +216,7 @@
* To be redefined in UnionDatatypeValidator
*/
- bool isSubstitutableBy(const DatatypeValidator* const toCheck);
+ virtual bool isSubstitutableBy(const DatatypeValidator* const toCheck);
//@}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org