MCPcopy Create free account
hub / github.com/cinder/Cinder / readStream

Method readStream

src/cinder/gl/ShaderPreprocessor.cpp:326–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326std::string ShaderPreprocessor::readStream( std::istream &input, const fs::path &sourcePath, int lineNumberStart, int versionNumber, set<fs::path> &includeTree )
327{
328 // go through each line and process includes
329 string line;
330 int lineNumber = lineNumberStart;
331 stringstream output;
332
333 while( getline( input, line ) ) {
334 std::string includeFilePath;
335 if( findIncludeStatement( line, &includeFilePath ) ) {
336 int numIncludesBefore = (int)includeTree.size();
337 output << parseRecursive( includeFilePath, sourcePath.parent_path(), versionNumber, includeTree );
338 output << getLineDirective( sourcePath, lineNumber, numIncludesBefore, versionNumber );
339 }
340 else
341 output << line << "\n";
342
343 lineNumber++;
344 }
345
346 return output.str();
347}
348
349std::string ShaderPreprocessor::getLineDirective( const fs::path &sourcePath, int lineNumber, int sourceStringNumber, int versionNumber ) const
350{

Callers

nothing calls this directly

Calls 4

findIncludeStatementFunction · 0.85
parent_pathMethod · 0.80
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected