MCPcopy Create free account
hub / github.com/Kitware/VTK / SetCharacterData

Method SetCharacterData

Common/DataModel/vtkXMLDataElement.cxx:167–194  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

165
166//------------------------------------------------------------------------------
167void vtkXMLDataElement::SetCharacterData(const char* data, int length)
168{
169 // Sanity check.
170 if (length < 0)
171 {
172 vtkWarningMacro("Negative values for length are not allowed, setting to 0!");
173 length = 0;
174 }
175 // Mark end of buffer.
176 this->EndOfCharacterData = length + 1;
177 // Size buffer in units of blocks.
178 this->CharacterDataBufferSize = this->CharacterDataBlockSize;
179 while (this->CharacterDataBufferSize < this->EndOfCharacterData)
180 {
181 this->CharacterDataBufferSize += this->CharacterDataBlockSize;
182 }
183 // Allocate the buffer.
184 this->CharacterData =
185 static_cast<char*>(realloc(this->CharacterData, this->CharacterDataBufferSize));
186 // Copy the data passed in.
187 if (data && length > 0)
188 {
189 memmove(this->CharacterData, data, length);
190 }
191 this->CharacterData[length] = 0;
192 // Mark us changed.
193 this->Modified();
194}
195
196//------------------------------------------------------------------------------
197void vtkXMLDataElement::SetAttribute(const char* name, const char* value)

Callers 13

DeepCopyMethod · 0.95
DrawStringMethod · 0.80
PrepareDocumentMethod · 0.80
writeScalarInfoFunction · 0.80
writeVectorInfoFunction · 0.80
WriteTreeLevelElementMethod · 0.80
WriteNameElementMethod · 0.80
WriteColorElementMethod · 0.80
WritePropertyElementMethod · 0.80
WriteSummaryXMLMethod · 0.80

Calls 1

ModifiedMethod · 0.45

Tested by

no test coverage detected