I would like to find out from within the program whether a given angelscript module contains an arbitrary string, e.g. "foo(123);" or "foo() >= bar()". The asIScriptModule class has methods for finding a few objects by their declarations, but AFAICT only global names. I know the filepath of the source text file for the module, but reopening the file and searching it seems like it would not be an optimal solution, not least because the file might have one or more #include directives and I'd have to reimplement the entire #include system from scratch. Is there any way to get the full (#include-expanded) source of a module?
Search module for string?
The original source code is not stored in asIScriptModule after the build is complete.
The #include directives are resolved by the CScriptBuilder, which also resolves any #if directives. I suggest you look into modifying this add-on to suit your needs.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Can you explain what you're trying to achieve?
Is this something that you might be able to pre-process during a build, or is it something you want to be able to dynamically detect at runtime?
11 hours ago, rip-off said:Is this something that you might be able to pre-process during a build, or is it something you want to be able to dynamically detect at runtime?
The former. As part of building a module, I would like to know whether any part of its source contains a specific string of characters.