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