Re: Review: Add config.sanityCheck

Malcolm Humphreys <malcolmh...@...>

Could we call this config.validate(), I know we are all a bit insane ;)

enum ConfigValid

What do you think about not throwing an exception but returning the enum and the error text?

something like:
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
if(config.validate(&errstr) == CONFIG_INVALID)
    // do something sane

On 21 Dec, 2010,at 01:26 PM, Jeremy Selan <jere...@...> wrote:

This will prevent the issues Blake encountered from happening again.

This also addresses an outstanding issue:

* Configs get a 'sanityCheck' call, which will validate the
configuration and throw an exception if any errors are detected. An
example of an error condition would be a role reference to a
colorspace that does not exist. Repeated calls to sanityCheck are
cached (and fast).

* Nuke plugins call sanityCheck() before the getProcessor() call.

* getColorSpace call is now not sensitive to case differences. Aka,
linear == LINEAR.

* The default role is only returned as the colorspace of 'last resort'
if strict_parsing is explicitly disabled. This will prevent
colorspace errors to silently roll by, unless requested.


-- Jeremy

Join to automatically receive all group messages.