Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 31 of file FuzzedDataProvider.h.

Constructor & Destructor Documentation

◆ FuzzedDataProvider() [1/2]

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

Definition at line 35 of file FuzzedDataProvider.h.

◆ ~FuzzedDataProvider()

FuzzedDataProvider::~FuzzedDataProvider ( )
default

◆ FuzzedDataProvider() [2/2]

FuzzedDataProvider::FuzzedDataProvider ( const FuzzedDataProvider )
privatedelete

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 288 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

◆ ConsumeBytes() [1/2]

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

Definition at line 108 of file FuzzedDataProvider.h.

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 136 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 118 of file FuzzedDataProvider.h.

◆ 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:

◆ ConsumeEnum()

template<typename T >
T FuzzedDataProvider::ConsumeEnum

Definition at line 295 of file FuzzedDataProvider.h.

◆ ConsumeFloatingPoint()

template<typename T >
T FuzzedDataProvider::ConsumeFloatingPoint

Definition at line 239 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

◆ ConsumeFloatingPointInRange()

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

Definition at line 248 of file FuzzedDataProvider.h.

Here is the call graph for this function:

◆ ConsumeIntegral()

template<typename T >
T FuzzedDataProvider::ConsumeIntegral

Definition at line 194 of file FuzzedDataProvider.h.

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

◆ ConsumeIntegralInRange()

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

Definition at line 204 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

◆ ConsumeProbability()

template<typename T >
T FuzzedDataProvider::ConsumeProbability

Definition at line 272 of file FuzzedDataProvider.h.

◆ ConsumeRandomLengthString() [1/2]

std::string FuzzedDataProvider::ConsumeRandomLengthString ( )
inline

Definition at line 180 of file FuzzedDataProvider.h.

◆ ConsumeRandomLengthString() [2/2]

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

Definition at line 152 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 128 of file FuzzedDataProvider.h.

Here is the caller graph for this function:

◆ ConsumeRemainingBytesAsString()

std::string FuzzedDataProvider::ConsumeRemainingBytesAsString ( )
inline

Definition at line 187 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.

◆ 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

◆ PickValueInArray() [1/3]

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

Definition at line 309 of file FuzzedDataProvider.h.

◆ PickValueInArray() [2/3]

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

Definition at line 303 of file FuzzedDataProvider.h.

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 315 of file FuzzedDataProvider.h.

◆ remaining_bytes()

size_t FuzzedDataProvider::remaining_bytes ( )
inline

Definition at line 84 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 99 of file FuzzedDataProvider.h.

◆ remaining_bytes_

size_t FuzzedDataProvider::remaining_bytes_
private

Definition at line 100 of file FuzzedDataProvider.h.


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