Qore DataStreamUtil Module Reference 1.1
DataStreamUtil.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
2// @file DataStreamUtil.qm Qore user module implementing support for the DataStream protocol: YAML-encoded HTTP chunked transfers where each chunk is a unique data entity
3
4/* DataStreamUtil.qm Copyright (C) 2014 - 2019 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// this module requires Qore 0.8.123or better
26
27// require type definitions everywhere
28
29// enable all warnings
30
31
32
33
34// do not use $ signs in declarations
35
36
37/* Version History: see docs below
38*/
39
306namespace DataStreamUtil {
308
312 const DataStreamContentType = "DataStream-Content-Type";
313
315 const DataStreamContentEncoding = "DataStream-Content-Encoding";
316
318 const DataStreamAccept = "DataStream-Accept";
319
321 const DataStreamAcceptEncoding = "DataStream-Accept-Encoding";
322
324 const DataStreamError = "DataStream-Error";
325
328
330
331 const DataStreamDeserializeYaml = ...;
332
333
334 const DataStreamDeserializeXml = ...;
335
336
337 const DataStreamDeserializationSupport = ...;
338
339
341
358 *code ds_get_content_decode(*string ce);
359
360
362
377 *code ds_get_content_encode(*string ce);
378
379
381
397 code ds_get_send(code scb, *code enc_func);
398
399
401
418 code ds_get_recv(code rcb, code ecb, *code bcb);
419
420
422
439 nothing ds_set_chunked_headers(reference<hash<auto>> hdr, *string content_encoding, *softbool req);
440
441
443
457 nothing ds_set_non_chunked_headers(reference<hash<auto>> hdr, *string content_encoding, *softbool req);
458
459
461
470 string ds_get_ds_accept_enc_header(*string ae);
471
472};
473
474// private namespace for non-exported definitions
475namespace DataStreamUtilPrivate {
476 // private function
477 ds_do_request_headers(reference<hash<auto>> hdr);
478
479};
the DataStreamUtil namespace contains all the public objects in the DataStreamUtil module
Definition: DataStreamUtil.qm.dox.h:306
*code ds_get_content_encode(*string ce)
returns a call reference (or nothing) based on an optional "Content-Encoding" header value for encodi...
const DataStreamError
HTTP trailer to be sent after chunked data has been transferred in case of an error on the sending si...
Definition: DataStreamUtil.qm.dox.h:324
code ds_get_send(code scb, *code enc_func)
returns a call reference useful for sending HTTP chunked data with Qore methods taking send callbacks...
const DataStreamContentEncoding
HTTP header for the data stream Content-Encoding header equivalent where each HTTP chunk is encoded/d...
Definition: DataStreamUtil.qm.dox.h:315
code ds_get_recv(code rcb, code ecb, *code bcb)
returns a call reference useful for receiving HTTP chunked data with Qore methods taking receive call...
nothing ds_set_chunked_headers(reference< hash< auto > > hdr, *string content_encoding, *softbool req)
sets up HTTP headers for DataStream chunked data transfers
const DataStreamContentType
HTTP header for the data stream Content-Type header equivalent where each HTTP chunk is encoded/decod...
Definition: DataStreamUtil.qm.dox.h:312
*code ds_get_content_decode(*string ce)
returns a call reference (or nothing) based on an optional "Content-Encoding" header value for decodi...
string ds_get_ds_accept_enc_header(*string ae)
returns the "DataStream-Accept-Encoding" header value corresponding to the "Accept-Encoding" header p...
const DataStreamAcceptEncoding
HTTP header for the data stream Accept-Encoding header equivalent where each HTTP chunk is encoded/de...
Definition: DataStreamUtil.qm.dox.h:321
const DataStreamAccept
HTTP header for the data stream Accept header equivalent where each HTTP chunk is encoded/decoded sep...
Definition: DataStreamUtil.qm.dox.h:318
nothing ds_set_non_chunked_headers(reference< hash< auto > > hdr, *string content_encoding, *softbool req)
sets up HTTP headers for DataStream non-chunked data transfers
const DataStreamContentEncodingHash
supported values for the DataStream-Accept-Encoding header
Definition: DataStreamUtil.qm.dox.h:327