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