BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslim::FuzzDataView Class Reference

#include <bslim_fuzzdataview.h>

Detailed Description

This type represents a view of a buffer of bytes provided by a fuzz testing harness.

See bslim_fuzzdataview

Public Member Functions

 FuzzDataView (const bsl::uint8_t *data, bsl::size_t size)
 
 FuzzDataView (const FuzzDataView &original)=default
 
 ~FuzzDataView ()=default
 
FuzzDataView removePrefix (bsl::size_t numBytes)
 
FuzzDataView removeSuffix (bsl::size_t numBytes)
 
const bsl::uint8_t * begin () const
 
const bsl::uint8_t * end () const
 
bsl::size_t length () const
 
const bsl::uint8_t * data () const
 

Constructor & Destructor Documentation

◆ FuzzDataView() [1/2]

bslim::FuzzDataView::FuzzDataView ( const bsl::uint8_t *  data,
bsl::size_t  size 
)
inline

Create a FuzzDataView object from the specified fuzz data and size.

Precondition
The behavior is undefined unless data || (0 == size).

◆ FuzzDataView() [2/2]

bslim::FuzzDataView::FuzzDataView ( const FuzzDataView original)
default

Create a FuzzDataView having the value of the specified original FuzzDataView.

◆ ~FuzzDataView()

bslim::FuzzDataView::~FuzzDataView ( )
default

Destroy this object.

Member Function Documentation

◆ begin()

const bsl::uint8_t * bslim::FuzzDataView::begin ( ) const
inline

Return a const pointer to the beginning of the buffer.

◆ data()

const bsl::uint8_t * bslim::FuzzDataView::data ( ) const
inline

Return a pointer to the beginning of the buffer.

◆ end()

const bsl::uint8_t * bslim::FuzzDataView::end ( ) const
inline

Return a const pointer to the end of the buffer.

◆ length()

bsl::size_t bslim::FuzzDataView::length ( ) const
inline

Return the length in bytes of the buffer.

◆ removePrefix()

FuzzDataView bslim::FuzzDataView::removePrefix ( bsl::size_t  numBytes)
inline

Assign to this FuzzDataView the value of the specified rhs FuzzDataView, and return a reference providing modifiable access to this object.

Note
Note that this trivial assignment operation is generated by the compiler. Remove the specified initial numBytes from this view if numBytes <= length() and remove length() bytes otherwise; return a view to the bytes that were removed.
Note that this method will decrease the length of this view by min(numBytes, length()) bytes.

◆ removeSuffix()

FuzzDataView bslim::FuzzDataView::removeSuffix ( bsl::size_t  numBytes)
inline

Remove the specified last numBytes from this view if numBytes <= length() and remove length() bytes otherwise; return a view to the bytes that were removed.

Note
Note that this method will decrease the length of this view by min(numBytes, length()) bytes.

The documentation for this class was generated from the following file: