MCPcopy Create free account
hub / github.com/PDAL/PDAL / outputDrivers

Method outputDrivers

apps/pdal.cpp:124–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122
123
124void App::outputDrivers()
125{
126 // Force plugin loading.
127 StageFactory f;
128 PluginManager<Stage>::loadAll();
129 StringList stages = PluginManager<Stage>::names();
130
131 if (!m_showJSON)
132 {
133 int nameColLen(28);
134 int descripColLen(Utils::screenWidth() - nameColLen - 1);
135
136 std::string tablehead(std::string(nameColLen, '=') + ' ' +
137 std::string(descripColLen, '='));
138
139 m_out << std::endl;
140 m_out << tablehead << std::endl;
141 m_out << std::left << std::setw(nameColLen) << "Name" <<
142 " Description" << std::endl;
143 m_out << tablehead << std::endl;
144
145 m_out << std::left;
146
147
148 for (auto name : stages)
149 {
150 std::string descrip = PluginManager<Stage>::description(name);
151 StringList lines = Utils::wordWrap(descrip, descripColLen - 1);
152 for (size_t i = 0; i < lines.size(); ++i)
153 {
154 m_out << std::setw(nameColLen) << name << " " <<
155 lines[i] << std::endl;
156 name.clear();
157 }
158 }
159
160 m_out << tablehead << std::endl << std::endl;
161 }
162 else
163 {
164 NL::json j;
165 StageExtensions& extensions = PluginManager<Stage>::extensions();
166 for (auto name : stages)
167 {
168 Stage *s = f.createStage(name);
169 std::string description = PluginManager<Stage>::description(name);
170 std::string link = PluginManager<Stage>::link(name);
171 j.push_back(
172 { { "name", name },
173 { "description", description },
174 { "link", link },
175 { "extensions", extensions.extensions(name) },
176 { "streamable", s->pipelineStreamable() }
177 }
178 );
179 }
180 m_out << std::setw(4) << j;
181 }

Callers

nothing calls this directly

Calls 6

descriptionFunction · 0.85
createStageMethod · 0.80
extensionsMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
pipelineStreamableMethod · 0.45

Tested by

no test coverage detected