KItinerary::BER::Element

Search for usage in LXR

KItinerary::BER::Element Class Reference

#include <berelement.h>

Public Member Functions

 Element (const QByteArray &data, int offset=0, int size=-1)
 
template<typename T >
const T * contentAt (int offset=0) const
 
const uint8_t * contentData () const
 
int contentSize () const
 
Element find (uint32_t type) const
 
Element first () const
 
bool isValid () const
 
Element next () const
 
const char * rawData () const
 
int size () const
 
uint32_t type () const
 

Static Public Member Functions

static void writeSize (QIODevice *out, int size)
 

Detailed Description

An element in BER/DER/X.690 encoding.

Implicitly this is also kinda implementing a QByteArrayRef, as this works without copying the underlying data.

Definition at line 27 of file berelement.h.

Constructor & Destructor Documentation

◆ Element()

BER::Element::Element ( const QByteArray & data,
int offset = 0,
int size = -1 )
explicit

Definition at line 24 of file berelement.cpp.

Member Function Documentation

◆ contentAt()

template<typename T >
const T * KItinerary::BER::Element::contentAt ( int offset = 0) const
inline

Convenience method to access typed content.

Definition at line 56 of file berelement.h.

◆ contentData()

const uint8_t * BER::Element::contentData ( ) const

Raw content data.

Definition at line 153 of file berelement.cpp.

◆ contentSize()

int BER::Element::contentSize ( ) const

Size of the value part of this element.

This is excluding a possible variable length end marker.

Definition at line 125 of file berelement.cpp.

◆ find()

BER::Element BER::Element::find ( uint32_t type) const

Returns the first child element of the given type.

Definition at line 172 of file berelement.cpp.

◆ first()

BER::Element BER::Element::first ( ) const

First child element, for nested types.

Definition at line 158 of file berelement.cpp.

◆ isValid()

bool BER::Element::isValid ( ) const

Returns true if this element has a valid structure and can be read from.

Definition at line 39 of file berelement.cpp.

◆ next()

BER::Element BER::Element::next ( ) const

Next child element, for nested types.

Definition at line 163 of file berelement.cpp.

◆ rawData()

const char * BER::Element::rawData ( ) const

Raw data of this element.

Typically only needed when copying/writing this element somewhere.

Definition at line 120 of file berelement.cpp.

◆ size()

int BER::Element::size ( ) const

Size of the entire element (type, size and content).

Definition at line 109 of file berelement.cpp.

◆ type()

uint32_t BER::Element::type ( ) const

Type, "right-aligned" in the returned 32bit value.

Definition at line 81 of file berelement.cpp.

◆ writeSize()

void BER::Element::writeSize ( QIODevice * out,
int size )
static

Writes the given size in BER encoding to out.

Definition at line 184 of file berelement.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.