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

Method CodecToHandle

IO/Core/vtkTextCodecFactory.cxx:125–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125vtkTextCodec* vtkTextCodecFactory::CodecToHandle(istream& SampleData)
126{
127 if (!vtkTextCodecFactory::Callbacks)
128 {
129 vtkTextCodecFactory::Initialize();
130 }
131 std::vector<vtkTextCodecFactory::CreateFunction>::iterator CF_i;
132 for (CF_i = Callbacks->begin(); CF_i != Callbacks->end(); ++CF_i)
133 {
134 vtkTextCodec* outCodec = (*CF_i)();
135 if (nullptr != outCodec)
136 {
137 if (outCodec->IsValid(SampleData))
138 {
139 return outCodec;
140 }
141 else
142 {
143 outCodec->Delete();
144 }
145 }
146 }
147
148 return nullptr;
149}
150
151static vtkTextCodec* vtkASCIITextCodecFromCallback()
152{

Callers

nothing calls this directly

Calls 5

DeleteMethod · 0.65
InitializeFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected