Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::state::ContentSizeBudget Class Reference

Running admission of archive entries against a ContentInstallLimits. More...

#include <content_install_limits.hpp>

Public Member Functions

 ContentSizeBudget (ContentInstallLimits limits={})
std::string admit (std::string_view entry_name, std::uint64_t bytes)
 Admit bytes for entry_name.
std::uint64_t admitted_bytes () const
std::uint64_t admitted_entries () const
const ContentInstallLimits & limits () const

Detailed Description

Running admission of archive entries against a ContentInstallLimits.

The runtime installer and the CLI share it so both refuse the same pack with the same message, naming the entry that crossed the line.

Constructor & Destructor Documentation

◆ ContentSizeBudget()

pulp::state::ContentSizeBudget::ContentSizeBudget ( ContentInstallLimits limits = {})
inlineexplicit

Member Function Documentation

◆ admit()

std::string pulp::state::ContentSizeBudget::admit ( std::string_view entry_name,
std::uint64_t bytes )
inline

Admit bytes for entry_name.

Returns an empty string when the entry fits, otherwise an issue naming the entry and the cap it exceeded. A refused entry is not counted, so the caller can stop at the first one.

◆ admitted_bytes()

std::uint64_t pulp::state::ContentSizeBudget::admitted_bytes ( ) const
inline

◆ admitted_entries()

std::uint64_t pulp::state::ContentSizeBudget::admitted_entries ( ) const
inline

◆ limits()

const ContentInstallLimits & pulp::state::ContentSizeBudget::limits ( ) const
inline

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