OpenEnroth 0259030
Loading...
Searching...
No Matches
Functions
pp Namespace Reference

Functions

Blob preprocess (const Blob &source, const FileSystem *pwd, std::string_view preamble, std::span< const std::string_view > passthroughDirectives)
 

Function Documentation

◆ preprocess()

Blob pp::preprocess ( const Blob source,
const FileSystem pwd,
std::string_view  preamble = {},
std::span< const std::string_view >  passthroughDirectives = {} 
)

Preprocesses source code, handling #include and #define directives.

Parameters
sourceThe source code to preprocess.
pwdFileSystem for resolving includes (relative to its root).
preambleOptional preamble prepended before preprocessing (e.g., #define GL_ES\n).
passthroughDirectivesDirectives that should pass through unchanged (e.g., {"version", "extension"}).
Returns
Preprocessed source code as a Blob.
Exceptions
ExceptionOn preprocessing errors.