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

Method GetAttributeString

IO/NetCDF/vtkNetCDFUGRIDReader.cxx:775–793  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

773
774//--------------------------------------------------------------------------------------------------
775std::string vtkNetCDFUGRIDReader::GetAttributeString(int var, std::string name)
776{
777 std::size_t size{};
778 if (!this->CheckError(nc_inq_attlen(this->NcId, var, name.c_str(), &size)))
779 {
780 vtkErrorMacro("Invalid mesh #" << var << ". Missing attribute " << name);
781 return "";
782 }
783
784 std::string output{};
785 output.resize(size);
786 if (!this->CheckError(nc_get_att_text(this->NcId, var, name.c_str(), output.data())))
787 {
788 vtkErrorMacro("Invalid mesh #" << var << ". Missing attribute " << name);
789 return "";
790 }
791
792 return output;
793}
794
795//--------------------------------------------------------------------------------------------------
796static vtkSmartPointer<vtkDataArray> MakeDataArray(nc_type type)

Callers 1

ParseHeaderMethod · 0.95

Calls 6

CheckErrorMethod · 0.95
nc_inq_attlenFunction · 0.85
nc_get_att_textFunction · 0.85
c_strMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected