Ignore:
Timestamp:
May 19, 2013, 9:20:51 AM (6 years ago)
Author:
cameron
Message:

Fixes for icXML 0.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/icxercesc/validators/schema/ComplexTypeInfo.hpp

    r3104 r3157  
    216216        ContentSpecNode*                   fContentSpec;
    217217        SchemaAttDef*                      fAttWildCard;
    218         SchemaAttDefList*                  fAttList;
     218    SchemaAttDefList                   fAttList;
    219219        RefVectorOf<SchemaElementDecl>*    fElements;
    220220        // TODO: should this really be a hash table? is it populated enough to be worthwhile?
     
    329329inline const SchemaAttDef* ComplexTypeInfo::getAttDef(const XMLCh* const baseName, const int uriId) const
    330330{
    331     return static_cast<const SchemaAttDef*>(fAttList->findAttDefLocalPart(uriId, baseName));
     331    return static_cast<const SchemaAttDef*>(fAttList.findAttDefLocalPart(uriId, baseName));
    332332//      return fAttDefs->get(baseName, uriId);
    333333}
     
    335335inline SchemaAttDef* ComplexTypeInfo::getAttDef(const XMLCh* const baseName, const int uriId)
    336336{
    337     return static_cast<SchemaAttDef*>(fAttList->findAttDefLocalPart(uriId, baseName));
     337    return static_cast<SchemaAttDef*>(fAttList.findAttDefLocalPart(uriId, baseName));
    338338    // return fAttDefs->get(baseName, uriId);
    339339}
     
    440440}
    441441
    442 inline void ComplexTypeInfo::setTypeName(const XMLCh* const typeName) {
    443 
    444         fMemoryManager->deallocate(fTypeName);//delete [] fTypeName;
    445         fMemoryManager->deallocate(fTypeLocalName);//delete [] fTypeLocalName;
    446         fMemoryManager->deallocate(fTypeUri);//delete [] fTypeUri;
    447 
    448         if (typeName)
    449         {
    450                 fTypeName = XMLString::replicate(typeName, fMemoryManager);
    451 
    452                 int index = XMLString::indexOf(fTypeName, chComma);
    453                 XMLSize_t length = XMLString::stringLen(fTypeName);
    454                 fTypeLocalName = (XMLCh*) fMemoryManager->allocate
    455                 (
    456                         (length - index + 1) * sizeof(XMLCh)
    457                 ); //new XMLCh[length - index + 1];
    458                 XMLString::subString(fTypeLocalName, fTypeName, index + 1, length, fMemoryManager);
    459 
    460                 fTypeUri = (XMLCh*) fMemoryManager->allocate
    461                 (
    462                         (index + 1) * sizeof(XMLCh)
    463                 ); //new XMLCh[index + 1];
    464                 XMLString::subString(fTypeUri, fTypeName, 0, index, fMemoryManager);
    465         }
    466         else
    467         {
    468                 fTypeName = fTypeLocalName = fTypeUri = 0;
    469         }
    470 }
    471 
    472442inline void
    473443ComplexTypeInfo::setBaseDatatypeValidator(DatatypeValidator* const validator) {
     
    488458}
    489459
    490 inline void ComplexTypeInfo::addElement(SchemaElementDecl* const elem) {
    491 
    492         if (!fElements) {
    493                 fElements = new (fMemoryManager) RefVectorOf<SchemaElementDecl>(8, false, fMemoryManager);
    494         }
    495         else if (fElements->containsElement(elem)) {
    496                 return;
    497         }
    498 
    499         fElements->addElement(elem);
    500 }
    501 
    502460inline void ComplexTypeInfo::setAttWildCard(SchemaAttDef* const toAdopt) {
    503461
     
    518476inline bool ComplexTypeInfo::hasAttDefs() const
    519477{
    520     return !fAttList->isEmpty();
     478    return !fAttList.isEmpty();
    521479    // return !fAttDefs->isEmpty();
    522480}
     
    524482inline bool ComplexTypeInfo::contains(const XMLCh* const attName)
    525483{
    526     SchemaAttDef** list = fAttList->fArray;
    527 
    528     for (XMLSize_t i = 0; i < fAttList->fCount; i++)
     484    SchemaAttDef** list = fAttList.fArray;
     485
     486    for (XMLSize_t i = 0; i < fAttList.fCount; i++)
    529487    {
    530488        if (XMLString::equals(attName, list[i]->getAttName()->getLocalPart()))
Note: See TracChangeset for help on using the changeset viewer.