Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
FuzzedDataProvider Class Reference

#include <FuzzedDataProvider.h>

Public Member Functions

 FuzzedDataProvider (const uint8_t *data, size_t size)
 ~FuzzedDataProvider ()=default
template<typename T>
std::vector< TConsumeBytes (size_t num_bytes)
template<typename T>
std::vector< TConsumeBytesWithTerminator (size_t num_bytes, T terminator=0)
template<typename T>
std::vector< TConsumeRemainingBytes ()
std::string ConsumeBytesAsString (size_t num_bytes)
std::string ConsumeRandomLengthString (size_t max_length)
std::string ConsumeRandomLengthString ()
std::string ConsumeRemainingBytesAsString ()
template<typename T>
T ConsumeIntegral ()
template<typename T>
T ConsumeIntegralInRange (T min, T max)
template<typename T>
T ConsumeFloatingPoint ()
template<typename T>
T ConsumeFloatingPointInRange (T min, T max)
template<typename T>
T ConsumeProbability ()
bool ConsumeBool ()
template<typename T>
T ConsumeEnum ()
template<typename T, size_t size>
T PickValueInArray (const T(&array)[size])
template<typename T, size_t size>
T PickValueInArray (const std::array< T, size > &array)
template<typename T>
T PickValueInArray (std::initializer_list< const T > list)
size_t ConsumeData (void *destination, size_t num_bytes)
size_t remaining_bytes ()

Private Member Functions

 FuzzedDataProvider (const FuzzedDataProvider &)=delete
FuzzedDataProvideroperator= (const FuzzedDataProvider &)=delete
void CopyAndAdvance (void *destination, size_t num_bytes)
void Advance (size_t num_bytes)
template<typename T>
std::vector< TConsumeBytes (size_t size, size_t num_bytes)
template<typename TS, typename TU>
TS ConvertUnsignedToSigned (TU value)

Private Attributes

const uint8_t * data_ptr_
size_t remaining_bytes_

Detailed Description

Definition at line 32 of file FuzzedDataProvider.h.

Constructor & Destructor Documentation

◆ FuzzedDataProvider() [1/2]

FuzzedDataProvider::FuzzedDataProvider ( const uint8_t * data,
size_t size )
inline

Definition at line 36 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

◆ ~FuzzedDataProvider()

FuzzedDataProvider::~FuzzedDataProvider ( )
default

◆ FuzzedDataProvider() [2/2]

FuzzedDataProvider::FuzzedDataProvider ( const FuzzedDataProvider & )
privatedelete
Here is the call graph for this function:

Member Function Documentation

◆ Advance()

void FuzzedDataProvider::Advance ( size_t num_bytes)
inlineprivate

Definition at line 343 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

◆ ConsumeBool()

bool FuzzedDataProvider::ConsumeBool ( )
inline

Definition at line 289 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ ConsumeBytes() [1/2]

template<typename T>
std::vector< T > FuzzedDataProvider::ConsumeBytes ( size_t num_bytes)

Definition at line 109 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeBytes() [2/2]

template<typename T>
std::vector< T > FuzzedDataProvider::ConsumeBytes ( size_t size,
size_t num_bytes )
private

Definition at line 352 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ ConsumeBytesAsString()

std::string FuzzedDataProvider::ConsumeBytesAsString ( size_t num_bytes)
inline

Definition at line 137 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeBytesWithTerminator()

template<typename T>
std::vector< T > FuzzedDataProvider::ConsumeBytesWithTerminator ( size_t num_bytes,
T terminator = 0 )

Definition at line 119 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ ConsumeData()

size_t FuzzedDataProvider::ConsumeData ( void * destination,
size_t num_bytes )
inline

Definition at line 329 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeEnum()

template<typename T>
T FuzzedDataProvider::ConsumeEnum ( )

Definition at line 296 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ ConsumeFloatingPoint()

template<typename T>
T FuzzedDataProvider::ConsumeFloatingPoint ( )

Definition at line 240 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeFloatingPointInRange()

template<typename T>
T FuzzedDataProvider::ConsumeFloatingPointInRange ( T min,
T max )

Definition at line 249 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeIntegral()

template<typename T>
T FuzzedDataProvider::ConsumeIntegral ( )

Definition at line 195 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ ConsumeIntegralInRange()

template<typename T>
T FuzzedDataProvider::ConsumeIntegralInRange ( T min,
T max )

Definition at line 205 of file FuzzedDataProvider.h.

◆ ConsumeProbability()

template<typename T>
T FuzzedDataProvider::ConsumeProbability ( )

Definition at line 273 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeRandomLengthString() [1/2]

std::string FuzzedDataProvider::ConsumeRandomLengthString ( )
inline

Definition at line 181 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeRandomLengthString() [2/2]

std::string FuzzedDataProvider::ConsumeRandomLengthString ( size_t max_length)
inline

Definition at line 153 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeRemainingBytes()

template<typename T>
std::vector< T > FuzzedDataProvider::ConsumeRemainingBytes ( )

Definition at line 129 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsumeRemainingBytesAsString()

std::string FuzzedDataProvider::ConsumeRemainingBytesAsString ( )
inline

Definition at line 188 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConvertUnsignedToSigned()

template<typename TS, typename TU>
TS FuzzedDataProvider::ConvertUnsignedToSigned ( TU value)
private

Definition at line 378 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

◆ CopyAndAdvance()

void FuzzedDataProvider::CopyAndAdvance ( void * destination,
size_t num_bytes )
inlineprivate

Definition at line 337 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

FuzzedDataProvider & FuzzedDataProvider::operator= ( const FuzzedDataProvider & )
privatedelete
Here is the call graph for this function:

◆ PickValueInArray() [1/3]

template<typename T, size_t size>
T FuzzedDataProvider::PickValueInArray ( const std::array< T, size > & array)

Definition at line 310 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ PickValueInArray() [2/3]

template<typename T, size_t size>
T FuzzedDataProvider::PickValueInArray ( const T(&) array[size])

Definition at line 304 of file FuzzedDataProvider.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PickValueInArray() [3/3]

template<typename T>
T FuzzedDataProvider::PickValueInArray ( std::initializer_list< const T > list)

Definition at line 316 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ remaining_bytes()

size_t FuzzedDataProvider::remaining_bytes ( )
inline

Definition at line 85 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

Member Data Documentation

◆ data_ptr_

const uint8_t* FuzzedDataProvider::data_ptr_
private

Definition at line 100 of file FuzzedDataProvider.h.

◆ remaining_bytes_

size_t FuzzedDataProvider::remaining_bytes_
private

Definition at line 101 of file FuzzedDataProvider.h.


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