mal-packet-weaver
C++20 packet serialization/deserialization library.
Loading...
Searching...
No Matches
mal_packet_weaver::crypto::KeyView Class Reference

Represents a view of a cryptographic key as a byte view. More...

#include "crypto-common.hpp"

Inheritance diagram for mal_packet_weaver::crypto::KeyView:
[legend]
Collaboration diagram for mal_packet_weaver::crypto::KeyView:
[legend]

Public Member Functions

template<typename T >
const T * as () const
 Convert the ByteView to a typed view.
 
constexpr ByteView subview (size_t from=0) const
 Create a subview of the ByteView.
 
constexpr ByteView subview (size_t from, size_t length) const
 Create a subview of the ByteView with a specified length.
 

Public Attributes

elements
 STL member.
 

Detailed Description

Represents a view of a cryptographic key as a byte view.

Definition at line 40 of file crypto-common.hpp.

Member Function Documentation

◆ as()

template<typename T >
const T * mal_toolkit::ByteView::as ( ) const
inlinenodiscardinherited

Convert the ByteView to a typed view.

This function interprets the underlying byte data as a sequence of the specified type and returns a pointer to the first element.

Template Parameters
TThe type to interpret the byte data as.
Returns
A pointer to the first element of the interpreted type.

Definition at line 44 of file byte-helper.hpp.

Here is the caller graph for this function:

◆ subview() [1/2]

ByteView mal_toolkit::ByteView::subview ( size_t from,
size_t length ) const
inlinenodiscardconstexprinherited

Create a subview of the ByteView with a specified length.

This function creates a new ByteView that represents a subsequence of the original ByteView starting from the specified index and having the specified length.

Parameters
fromThe starting index of the subview.
lengthThe length of the subview.
Returns
A new ByteView representing the subview.

Definition at line 74 of file byte-helper.hpp.

◆ subview() [2/2]

ByteView mal_toolkit::ByteView::subview ( size_t from = 0) const
inlinenodiscardconstexprinherited

Create a subview of the ByteView.

This function creates a new ByteView that represents a subsequence of the original ByteView starting from the specified index.

Parameters
fromThe starting index of the subview.
Returns
A new ByteView representing the subview.

Definition at line 58 of file byte-helper.hpp.

Member Data Documentation

◆ elements

T std::span< T >::elements
inherited

STL member.


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