🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Search module for string?

Started by
3 comments, last by Violet CLM 6 years, 11 months ago

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?

Advertisement

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.

This topic is closed to new replies.

Advertisement