abstract struct RPM::TagData::ReturnType(T)

Overview

Generic ReturnType class for integral types.

Direct Known Subclasses

Defined in:

rpm/tagdata.cr

Instance Method Summary

Instance methods inherited from struct RPM::TagData::ReturnTypeBase

detach detach, format(io : IO, index : Int, fmt : TagDataFormat)
format(index : Int, fmt : TagDataFormat)
format(io : IO, fmt : TagDataFormat)
format
, return_type return_type, size size, tag tag, tag=(tag : Tag | TagValue) tag=, to_a to_a, to_unsafe : RPM::LibRPM::TagData to_unsafe, type type, unsafe_fetch(index : Int) unsafe_fetch

Constructor methods inherited from struct RPM::TagData::ReturnTypeBase

new new

Instance Method Detail

def bytes : Slice(T) #

Returns binary raw array of expecting type.

Raises NilAssertionError if #fetch_ptr returns NULL.


[View source]
def bytes? : Slice(T)? #

Returns binary raw array of expecting type.

Returns nil if #fetch_ptr returns NULL.


[View source]
abstract def fetch_ptr : Pointer(T) #

We needs a method to get pointer data.


[View source]
def to_a : Array(T) #

Returns the array of values using #bytes

This may be faster than Indexable#to_a


[View source]