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/xercesc/validators/schema/identity/FieldValueMap.cpp

    r2722 r3157  
    120120}
    121121
     122// ---------------------------------------------------------------------------
     123//  FieldValueMap: Setter methods
     124// ---------------------------------------------------------------------------
     125void FieldValueMap::put(IC_Field* const key, DatatypeValidator* const dv, const XMLCh* const value)
     126{
     127    if (!fFields) {
     128        fFields = new (fMemoryManager) ValueVectorOf<IC_Field*>(4, fMemoryManager);
     129        fValidators = new (fMemoryManager) ValueVectorOf<DatatypeValidator*>(4, fMemoryManager);
     130        fValues = new (fMemoryManager) RefArrayVectorOf<XMLCh>(4, true, fMemoryManager);
     131    }
     132
     133    XMLSize_t keyIndex;
     134    if (!indexOf(key, keyIndex))
     135    {
     136        fFields->addElement(key);
     137        fValidators->addElement(dv);
     138        fValues->addElement(XMLString::replicate(value, fMemoryManager));
     139    }
     140    else
     141    {
     142        fValidators->setElementAt(dv, keyIndex);
     143        fValues->setElementAt(XMLString::replicate(value, fMemoryManager), keyIndex);
     144    }
     145}
     146
    122147XERCES_CPP_NAMESPACE_END
    123148
Note: See TracChangeset for help on using the changeset viewer.