ObjectHandler/gensrc regex questions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ObjectHandler/gensrc regex questions

Jan Ladislav Dussek
I have a couple of unrelated questions (observations?), both of which happen to be about regular expressions.

1. ObjectHandler/Excel: The regex which deals with Excel cell references (for logging, etc.) in the RangeReference class seems to be a bit unforgiving about file and sheet names. I tend to use the ohRangeRetrieveError function a lot, and it won't work if, for example, the file name has parentheses in it or the sheet name contains a period.

2. gensrc: I want to expose a custom class to Excel (Bar) which is in a sub-namespace (Foo) of QuantLib, i.e., QuantLib::Foo::Bar. I write a wrapper QuantLibAddin::Foo::Bar for this class. In my category .xml file, I put Foo::Bar in the <libraryFunction> tag.

This seems to me to be the 'obvious' way to export a class from a sub-namespace (I could be wrong), but it's prevented from working by the fulltype.FullType.RE_NAMESPACE regex (.*)::(.*) which takes everything after the last '::' to be the class name.

Everything works if I change this regex to ([^:]*)::(.*) taking everything after the first '::' to be the class name, but for maintainability I prefer not to touch 3rd-party code. Also, this change implicitly assumes that the library namespace and object namespace are not themselves sub-namespaces. Is there a better solution that I'm missing (outside of "don't use sub-namespaces"...)?

Regards,

-JLD    
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users