The variable list in EXEPlug is delievered in a COMMATEXT format, however, it turns out that handling all the rules is not straight-forward. Is there some official code available showing how to parse the variable list, re-encode and handle the substitutions efficiently? I was thinking about writing my own, or using something like boost Tokenizer, but the best would be to use whatever IA is using already - since the plugin needs to return the NewVariables list in the same way that it received the Variables list.
In my case, I just want to return a value as true, but I think the steps need to be:
1. Parse the Variables string into some kind of map or hashtable (correctly handling quotes, double-quotes, \", commas in between quotes)
2. Handle all substitutions of incoming text (e.g., $TITLE$)
3. Change the value of the target variable (I guess we can't just append, since the target variable must be created ahead of time with Set Variable)
3. Re-encode into the correct IA variables string format (values are not always double-quoted, for example)
Thank you much.
Respectfully,
Tim
Code for parsing variable lists and handling substitutions
Re: Code for parsing variable lists and handling substitutio
In case anyone wonders, IA uses double-double-quotes (hmm, that makes me hungry), which needs to be accounted for if you use boost Tokenizer.
HASIT,"George's ""companion"" wasn't happy. "
Probably \ stay where they are.
HASIT,"George's ""companion"" wasn't happy. "
Probably \ stay where they are.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Code for parsing variable lists and handling substitutio
Dear Tim,
unfortunately doesn't exist an official IA function or routine to handle COMMATEXT format.
I suppose that every developer have realized a custom one ( ... as I have done with my plug-ins).
I can only suggest you to have a look at the following link (if you haven't):
http://www.installaware.com/forum/viewtopic.php?f=3&t=3424
The source code available is a good starting point.
Regards
unfortunately doesn't exist an official IA function or routine to handle COMMATEXT format.
I suppose that every developer have realized a custom one ( ... as I have done with my plug-ins).
I can only suggest you to have a look at the following link (if you haven't):
http://www.installaware.com/forum/viewtopic.php?f=3&t=3424
The source code available is a good starting point.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Code for parsing variable lists and handling substitutio
"every developer have realized a custom one"
Doesn't that seem crazy?
Doesn't that seem crazy?
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Code for parsing variable lists and handling substitutio
I don't agree.
The target is to handle the COMMATEXT format as it is required but it is not required to have a standard strategy to do it.
For example in my case, I have developed a custom C++ Framework class to handle all IA plugin low level functionality.
Every plugin that I realize is derived from that class.
The class is also responsable of all required COMMATEXT format operations and I use a very personalized approach to manage variables and values.
Honestly ... I do not feel crazy!
Regards
The target is to handle the COMMATEXT format as it is required but it is not required to have a standard strategy to do it.
For example in my case, I have developed a custom C++ Framework class to handle all IA plugin low level functionality.
Every plugin that I realize is derived from that class.
The class is also responsable of all required COMMATEXT format operations and I use a very personalized approach to manage variables and values.
Honestly ... I do not feel crazy!
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Code for parsing variable lists and handling substitutions
IMO, @tofutim is making a valid point above. A good framework to develop plug-ins should have such helper functions.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Code for parsing variable lists and handling substitutions
In fact, we don't provide a framework...but a SDK. Of course, @tofutim is making a valid point above ...and this may be something to add in future versions.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Return to “Plug-In Development”
Who is online
Users browsing this forum: No registered users and 2 guests