Jump to content
  • Advertisement
Violet CLM

Search module for string?

This topic is 443 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!