SodiumPointer<T extends NativeType> class
A C-Pointer wrapper that uses the memory utilities of libsodium.
Constructors
- SodiumPointer.alloc(LibSodiumFFI sodium, {int count = 1, MemoryProtection memoryProtection = MemoryProtection.readWrite, bool zeroMemory = false})
-
Allocates new memory using the libsodium APIs.
factory
-
SodiumPointer.raw(LibSodiumFFI sodium, Pointer<
T> ptr, int count) -
Constructs the pointer from the lib
sodium
API, the rawptr
and the elementcount
.
Properties
- byteLength → int
-
The total number of bytes this pointer is long
no setter
- count → int
-
The number of elements this pointer is pointing to
final
- elementSize → int
-
The number of bytes a single element of T is wide.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- locked ↔ bool
-
Controlls whether the pointer is locked in memory or not.
getter/setter pair
- memoryProtection ↔ MemoryProtection
-
Controlls the memory protection level of the allocated memory
getter/setter pair
-
ptr
→ Pointer<
T> -
The underlying native C pointer
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sodium → LibSodiumFFI
-
libsodium bindings used to access the C API
final
Methods
-
asList(
[int? length]) → Float64List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Double> , provided by the DoubleSodiumPtr extension -
asList(
[int? length]) → Float32List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Float> , provided by the FloatSodiumPtr extension -
asList(
[int? length]) → Int8List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Int8> , provided by the Int8SodiumPtr extension -
asList(
[int? length]) → Int16List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Int16> , provided by the Int16SodiumPtr extension -
asList(
[int? length]) → Int32List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Int32> , provided by the Int32SodiumPtr extension -
asList(
[int? length]) → Int64List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Int64> , provided by the Int64SodiumPtr extension -
asList(
[int? length]) → Uint8List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Uint8> , provided by the Uint8SodiumPtr extension -
asList(
[int? length]) → Uint16List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Uint16> , provided by the Uint16SodiumPtr extension -
asList(
[int? length]) → Uint32List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Uint32> , provided by the Uint32SodiumPtr extension -
asList(
[int? length]) → Uint64List -
Available on SodiumPointer<
Returns a dart list view on the pointer.Uint64> , provided by the Uint64SodiumPtr extension -
copyAsList(
[int? length]) → Float64List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Double> , provided by the DoubleSodiumPtr extension -
copyAsList(
[int? length]) → Float32List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Float> , provided by the FloatSodiumPtr extension -
copyAsList(
[int? length]) → Int8List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Int8> , provided by the Int8SodiumPtr extension -
copyAsList(
[int? length]) → Int16List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Int16> , provided by the Int16SodiumPtr extension -
copyAsList(
[int? length]) → Int32List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Int32> , provided by the Int32SodiumPtr extension -
copyAsList(
[int? length]) → Int64List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Int64> , provided by the Int64SodiumPtr extension -
copyAsList(
[int? length]) → Uint8List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Uint8> , provided by the Uint8SodiumPtr extension -
copyAsList(
[int? length]) → Uint16List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Uint16> , provided by the Uint16SodiumPtr extension -
copyAsList(
[int? length]) → Uint32List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Uint32> , provided by the Uint32SodiumPtr extension -
copyAsList(
[int? length]) → Uint64List -
Available on SodiumPointer<
Returns a dart list copy off the pointer.Uint64> , provided by the Uint64SodiumPtr extension -
dispose(
) → void - Disposes the pointer and frees the allocated memory.
-
fill(
List< num> data, {int offset = 0}) → void - Fills an area of the memory with the given data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDartString(
{bool zeroTerminated = false}) → String -
Available on SodiumPointer<
Converts the pointer to a dart string using the utf8 encoding.Int8> , provided by the Int8SodiumPtr extension -
toString(
) → String -
A string representation of this object.
inherited
-
viewAt(
int offset, [int? length]) → SodiumPointer< T> - Returns a view of a subset of the memory the pointer is pointing to.
-
zeroMemory(
) → void - Provides sodium_memzero
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited