On 2015-04-12 11:53, Suliman wrote:

But could you explain why if binding have next string:

enum CPLErr
{
     CE_None = 0,
     CE_Debug = 1,
     CE_Warning = 2,
     CE_Failure = 3,
     CE_Fatal = 4
}

I can't use:
if( GDALGetGeoTransform( hDataset, adfGeoTransform.ptr ) == CE_None )

In D you need to include the name of the enum type as well: CPLErr.CE_None. If you want to avoid that you can use aliases:

alias CE_None = CPLErr.CE_None

Or the with-statement:

with (CPLErr)
{
// inside this block all the members of CPLErr can be accessed without prefixing them with CPLErr
  if( GDALGetGeoTransform( hDataset, adfGeoTransform.ptr ) == CE_None )
  {
  }
}

--
/Jacob Carlborg

Reply via email to