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

Method SetAttributeValueAsString

IO/MINC/vtkMINCImageAttributes.cxx:824–837  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

822
823//------------------------------------------------------------------------------
824void vtkMINCImageAttributes::SetAttributeValueAsString(
825 const char* variable, const char* attribute, const char* value)
826{
827 size_t length = strlen(value);
828
829 vtkCharArray* array = vtkCharArray::New();
830 // Allocate an extra byte to store a null terminator.
831 array->Resize(static_cast<vtkIdType>(length + 1));
832 char* dest = array->WritePointer(0, static_cast<vtkIdType>(length));
833 strcpy(dest, value);
834 this->SetAttributeValueAsArray(variable, attribute, array);
835
836 array->Delete();
837}
838
839//------------------------------------------------------------------------------
840void vtkMINCImageAttributes::SetAttributeValueAsInt(

Callers 1

Calls 5

NewFunction · 0.70
DeleteMethod · 0.65
ResizeMethod · 0.45
WritePointerMethod · 0.45

Tested by

no test coverage detected