MCPcopy Create free account
hub / github.com/comaps/comaps / IndexToClassificatorType

Function IndexToClassificatorType

libs/kml/pykmlib/bindings.cpp:647–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645}
646
647std::string IndexToClassificatorType(uint32_t index)
648{
649 auto const & c = classif();
650 if (!c.HasTypesMapping())
651 throw std::runtime_error("Types mapping is not loaded.");
652
653 uint32_t t;
654 try
655 {
656 t = c.GetTypeForIndex(index);
657 }
658 catch (std::out_of_range const & exc)
659 {
660 throw std::runtime_error("Type is not found. index: " + std::to_string(index));
661 }
662
663 if (!c.IsTypeValid(t))
664 throw std::runtime_error("Type is not valid. type: " + std::to_string(t));
665
666 return c.GetReadableObjectName(t);
667}
668} // namespace
669
670BOOST_PYTHON_MODULE(pykmlib)

Callers

nothing calls this directly

Calls 5

to_stringFunction · 0.85
HasTypesMappingMethod · 0.80
IsTypeValidMethod · 0.80
GetReadableObjectNameMethod · 0.80
GetTypeForIndexMethod · 0.45

Tested by

no test coverage detected