Posted by
Kris . on
Apr 26, 2002; 12:54pm
URL: http://quantlib.414.s1.nabble.com/Periods-and-such-from-strings-tp2020p2023.html
Hi,
>
> As Luigi mentioned dates have additional complexity as the same date can be
> represented in multiple formats. Some formats are locale-independent, e.g.
> "YYYYMMDD", and some are, e.g. "MM/DD/YYYY" vs "DD/MM/YYYY".
>
> I found it useful to have a set of locale-independent date parsing functions
> (e.g. I have setFromYyyyMmDd(std::string, Date &),
> setFromMmDdYyyy(std::string, Date &)). Having such functions should allow a
This separation of concerns is an interesting issue, and is often
times a context/enviroment dependant thing. In an earlier avatar
as a java programmer we had to do something simillar and ended up
using AspectJ , which cross-cuts code as aspects, so for instance
Locale is an aspect of the code , the aspect preprocessor(an understatement)
would then massage the existing cpp files to take care of all points
where locales are to be handled in a specific way. Debug messages
is another aspect, logging another aspect of the system.
Now there is a cpp port of aspects that i amnt sure how mature it is
but it should be interesting development.
http://www.aspectc.org/&
http://www.aosd.net/cheers,
Kris