Menu

#190 !define /file support, !searchparse support

closed
NSIS (71)
5
2008-07-13
2008-07-11
No

This patch enables two new things:

1)

!define /file SYMBOL filename.cpp

(inserts the contents of filename.cpp into the defined symbol 'SYMBOL').

2)

!searchparse [/file] [/noerrors] [/ignorecase] STRING_OR_FILENAME "StringToMatch1" SYMBOL_OUT1 ["StringToMatch2" [SYMBOL_OUT2 ["String to Match3" [SYMBOL_OUT3 ...]]]]

This allows you to parse either defined strings or analyze entire source files.. For example:

!searchparse /file main_common.cpp `#define MAIN_APP_VERSION "` VER_MAJOR `.` VER_MINOR `"`

This will look through main_common.cpp to find the line:

#define MAIN_APP_VERSION "3.5" and set ${VER_MAJOR} to 3, ${VER_MINOR} to 5.

(for the /file mode):
If multiple lines fully match, the first match will be used. If no line fully matches, an error will be displayed, unless /noerrors is set, in which case the later symbols will not be defined and the best match will be used.

(for the string mode):
If no full match is found an error is displayed, unless /noerrors is set...

-Justin

Discussion

  • Justin Frankel

    Justin Frankel - 2008-07-11

    Patchfile against SVN 5675

     
  • Justin Frankel

    Justin Frankel - 2008-07-13
    • status: open --> closed
     

Log in to post a comment.