Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Compression::Result Struct Reference

Contains the result of a compression or extraction operation. More...

#include <StringCompression.h>

Public Types

using Dynamic = std::unique_ptr< std::byte[]>
 
using Static = std::array< std::byte, 128 KiB >
 

Public Member Functions

std::string_view GetStringView () const
 Returns a view (of type char) of the internal store. More...
 
ContiguousByteBufferView GetView () const
 Returns a view (of type std::byte) of the internal store. More...
 

Public Attributes

size_t Size
 The length of valid data in the store. More...
 
std::variant< Static, DynamicStorage
 A store allocated on either the stack or heap. More...
 

Static Public Attributes

static constexpr size_t StaticCapacity = sizeof(Compression::Result::Static) / sizeof(Compression::Result::Static::value_type)
 

Detailed Description

Contains the result of a compression or extraction operation.

Definition at line 22 of file StringCompression.h.

Member Typedef Documentation

◆ Dynamic

using Compression::Result::Dynamic = std::unique_ptr<std::byte[]>

Definition at line 25 of file StringCompression.h.

◆ Static

using Compression::Result::Static = std::array<std::byte, 128 KiB>

Definition at line 24 of file StringCompression.h.

Member Function Documentation

◆ GetStringView()

std::string_view Compression::Result::GetStringView ( ) const

Returns a view (of type char) of the internal store.

Definition at line 16 of file StringCompression.cpp.

◆ GetView()

ContiguousByteBufferView Compression::Result::GetView ( ) const

Returns a view (of type std::byte) of the internal store.

Definition at line 26 of file StringCompression.cpp.

Member Data Documentation

◆ Size

size_t Compression::Result::Size

The length of valid data in the store.

Definition at line 39 of file StringCompression.h.

◆ StaticCapacity

constexpr size_t Compression::Result::StaticCapacity = sizeof(Compression::Result::Static) / sizeof(Compression::Result::Static::value_type)
staticconstexpr

Definition at line 27 of file StringCompression.h.

◆ Storage

std::variant<Static, Dynamic> Compression::Result::Storage

A store allocated on either the stack or heap.

Definition at line 36 of file StringCompression.h.


The documentation for this struct was generated from the following files: