Skip to content

Commit

Permalink
Merge pull request #6 from Dewberry/feature/cpl-config
Browse files Browse the repository at this point in the history
set and get cpl options
  • Loading branch information
albrazeau authored Jun 14, 2021
2 parents 4416208 + 47a4739 commit cba7106
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions gdal.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,25 @@ func goGDALProgressFuncProxyA(complete C.double, message *C.char, data unsafe.Po
)
}

// CPLSetConfigOption
func CPLSetConfigOption(key, val string) {
cKey := C.CString(key)
defer C.free(unsafe.Pointer(cKey))
cVal := C.CString(val)
defer C.free(unsafe.Pointer(cVal))
C.CPLSetConfigOption(cKey, cVal)
}

// CPLGetConfigOption
func CPLGetConfigOption(key, val string) string {
cKey := C.CString(key)
defer C.free(unsafe.Pointer(cKey))

cVal := C.CString(val)
defer C.free(unsafe.Pointer(cVal))
return C.GoString(C.CPLGetConfigOption(cKey, cVal))
}

/* ==================================================================== */
/* Registration/driver related. */
/* ==================================================================== */
Expand Down

0 comments on commit cba7106

Please sign in to comment.