Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapped VSIMemFile methods #203

Merged
merged 3 commits into from
Aug 3, 2021

Conversation

ChristianBeilschmidt
Copy link
Contributor

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

I mapped the methods VSIFileFromMemBuffer, VSIUnlink, VSIGetMemFileBuffer.
Since I haven't found a good place to put them, I created a new vsi module in the root.

There are two methods for creation and retrieval that work with owned data, such that either we give the ownership from our Rust object to GDAL's CPP context or vice versa.

Moreover, there are two methods that work with references and they do not hand over ownership. This is more complicated since we don't want to introduce memory leaks. I created a retrieval method that only gets a function so that we do not hand out data but only a computation result from the function. For creation, I introduced a MemFileRef struct that handles the lifetime to the referenced data.

It would be nice if someone would check that my solution makes sense in that case.

@jdroenner jdroenner merged commit f7b8aec into georust:master Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants