@@ -321,71 +321,12 @@ enum CborParserIteratorFlags
321
321
322
322
struct CborValue ;
323
323
324
- /**
325
- * Defines an interface for abstract document readers. This structure is used
326
- * in conjunction with \ref cbor_parser_init_reader to define how the various
327
- * required operations are to be implemented.
328
- */
324
+
329
325
struct CborParserOperations
330
326
{
331
- /**
332
- * Determines whether \a len bytes may be read from the reader. This is
333
- * called before \ref read_bytes and \ref transfer_bytes to ensure it is safe
334
- * to read the requested number of bytes from the reader.
335
- *
336
- * \param value The CBOR value being parsed.
337
- *
338
- * \param len The number of bytes sought.
339
- *
340
- * \retval true \a len bytes may be read from the reader.
341
- * \retval false Insufficient data is available to be read at this time.
342
- */
343
327
bool (* can_read_bytes )(const struct CborValue * value , size_t len );
344
-
345
- /**
346
- * Reads \a len bytes from the reader starting at \a offset bytes from
347
- * the current read position and copies them to \a dst. The read pointer
348
- * is *NOT* modified by this operation.
349
- *
350
- * \param value The CBOR value being parsed.
351
- *
352
- * \param dst The buffer the read bytes will be copied to.
353
- *
354
- * \param offset The starting position for the read relative to the
355
- * current read position.
356
- *
357
- * \param len The number of bytes sought.
358
- */
359
328
void * (* read_bytes )(const struct CborValue * value , void * dst , size_t offset , size_t len );
360
-
361
- /**
362
- * Skips past \a len bytes from the reader without reading them. The read
363
- * pointer is advanced in the process.
364
- *
365
- * \param value The CBOR value being parsed.
366
- *
367
- * \param len The number of bytes skipped.
368
- */
369
329
void (* advance_bytes )(struct CborValue * value , size_t len );
370
-
371
- /**
372
- * Overwrite the user-supplied pointer \a userptr with the address where the
373
- * data indicated by \a offset is located, then advance the read pointer
374
- * \a len bytes beyond that point.
375
- *
376
- * This routine is used for accessing strings embedded in CBOR documents
377
- * (both text and binary strings).
378
- *
379
- * \param value The CBOR value being parsed.
380
- *
381
- * \param userptr The pointer that will be updated to reference the location
382
- * of the data in the buffer.
383
- *
384
- * \param offset The starting position for the read relative to the
385
- * current read position.
386
- *
387
- * \param len The number of bytes sought.
388
- */
389
330
CborError (* transfer_string )(struct CborValue * value , const void * * userptr , size_t offset , size_t len );
390
331
};
391
332
0 commit comments