void append(const char *chars, XMLSize_t len) { if(chars != 0 && len != 0) { if(fIndex + len >= fCapacity) { insureCapacity(len); } memcpy(&fBuffer[fIndex], chars, len * sizeof(char)); fIndex += len; } }
void LocalFileFormatTarget::writeChars(const XMLByte* const toWrite , const unsigned int count , XMLFormatter * const ) { if (count) { insureCapacity(count); memcpy(&fDataBuf[fIndex], toWrite, count * sizeof(XMLByte)); fIndex += count; } return; }
void BinMemOutputStream::writeBytes( const XMLByte* const toGo , const unsigned int maxToWrite) { if (maxToWrite) { insureCapacity(maxToWrite); memcpy(&fDataBuf[fIndex], toGo, maxToWrite * sizeof(XMLByte)); fIndex += maxToWrite; } }
void MemBufFormatTarget::writeChars(const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter * const) { if (count) { insureCapacity(count); memcpy(&fDataBuf[fIndex], toWrite, count * sizeof(XMLByte)); fIndex += count; } }
void appendDecimalNumber(unsigned int n) { if(n >= 10) { appendDecimalNumber(n / 10); n = n % 10; } if(fIndex + 1 >= fCapacity) insureCapacity(1); fBuffer[fIndex] = '0' + n; ++fIndex; }
XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLBuffer: Buffer management // --------------------------------------------------------------------------- void XMLBuffer::append(const XMLCh* const chars, const unsigned int count) { unsigned int actualCount = count; if (!count) actualCount = XMLString::stringLen(chars); insureCapacity(actualCount); memcpy(&fBuffer[fIndex], chars, actualCount * sizeof(XMLCh)); fIndex += actualCount; }
void append(const char *chars) { if(chars != 0 && *chars != 0) { // get length of chars XMLSize_t count = 0; for(; *(chars+count); ++count); if(fIndex + count >= fCapacity) { insureCapacity(count); } memcpy(&fBuffer[fIndex], chars, count * sizeof(char)); fIndex += count; } }
void LocalFileFormatTarget::writeChars(const XMLByte* const toWrite , const unsigned int count , XMLFormatter * const ) { if (count) { if (insureCapacity(count)) { memcpy(&fDataBuf[fIndex], toWrite, count * sizeof(XMLByte)); fIndex += count; } else { //flush whatever we have in the buffer and the incoming byte stream flushBuffer(); XMLPlatformUtils::writeBufferToFile(fSource, (long) count, toWrite, fMemoryManager); } } return; }