Closed mrkraimer closed 6 years ago
@mrkraimer Regarding your latest pair of commits, strtol()
and strtod()
don't throw, so your try
wrappers around these calls don't make much sense.
Note that from Base-3.15 onwards epicsStdlib.h provides a series of epicsParse*()
functions which do string to number conversions and check that the value is within the legal range for the type (they return a status code).
On 04/10/2017 03:55 PM, Andrew Johnson wrote:
@mrkraimer https://github.com/mrkraimer Regarding your latest pair of commits, |strtol()| and |strtod()| don't throw, so your |try| wrappers around these calls don't make much sense.
Note that from Base-3.15 onwards epicsStdlib.h provides a series of |epicsParse*()| functions which do string to number conversions and check that the value is within the legal range for the type (they return a status code).
Have a look at typeCast.h and castUnsafe
To translate from michael-speak that would be the header pv/typeCast.h
and the functions epics::pvData::castUnsafe<epicsType>(someString)
, which wrap the epicsParse*()
functions (and do throw).
Hey, I wasn't going to type an essay with a smartphone.
I removed the try/catch around the calls to strtol. I did not use the new features from epicsStdlib.h because I think it is important that pvDataCPP still work with 3.14 releases.
Also note that std::stol does trap exceptions;
Exceptions std::invalid_argument if no conversion could be performed std::out_of_range if the converted value would fall out of the range of the result type or if the underlying function (std::strtol or std::strtoll) sets errno to ERANGE.
But this requires c++11. Again I will ask when we can make epics base c++11 compatible?
I am closing this pull request. It was decided that plugin support would not be implemented until there are users requests for it.
Implement plugin filters for copy facility. This is modeled after the plugin filters that were introduced in epics base 3.15.