• Advertisement

Search module for string?

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

 

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement