-
Notifications
You must be signed in to change notification settings - Fork 37
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
API: Added utilities to operate on blob streams as stdio FILEs #255
base: master
Are you sure you want to change the base?
Conversation
This looks like it might be helpful -> https://github.com/Snaipe/fmem |
Header is not in the `include/cbl` directory since this isn't official API.
|
The build is failing now. Should be #include "CBLBlob+FILE.h" instead of "CBLBlob+File.h".
|
yes keep that work up as the WSL on windows allows that also i guess even cygwin allows that we also use that to binary pipe blobs into chrome on windows via the devtools protocol and this is a nice feat as it will allow my wasm implementation to take browser blobs directly in and out that makes streaming to the couchbase cluster via direct socket api experiment that we currently run much more nice. Only for your interrest i am building a poc that directly uses current chromium dev the feat is already included to directly connect via the couchbase sdk to a couchbase cluster anyway i also build cblite to wasm and i am using then the binary in and output it would help me if you could maybe make the fleece api run able more isolated so that i could create cblite with indexdb to run complet in the browser. |
@snej Can you check the build failure? |
@pasin please use the latest version and tell me if that happens with that also |
This lets you read and write blobs using standard C functions like
fread
,fseek
,fwrite
, similarly to the way other CBL platforms let you use the platform's stream classes.The API is in
src/CBLBlob+FILE.h
. This is not in theinclude/cbl
directory since it isn't (yet?) official API.Unfortunately I was unable to find a way to implement this on Windows, since (apparently?) it does not have a function equivalent to
funopen
orfopencookie
for creating aFILE*
with custom I/O callbacks. Still, it seems a shame to leave out this feature, especially since the majority of CBL-C clients will probably be Linux-based.