codex
Loading...
Searching...
No Matches
cmd.hpp File Reference
#include <concepts>
#include <cstddef>
#include <functional>
#include <vector>
#include "block.hpp"
Include dependency graph for cmd.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Concepts

concept  EncodeFunc
 
concept  DecodeFunc
 

Macros

#define BASE64_MAIN(T)    int main(int, const char **argv) { return !cmd_main<T>(argv); }
 

Functions

template<auto S, std::integral T>
constexpr T round_to_block_size (T n)
 Rounds an integral value to a given block size, always towards infinity.
 
template<std::size_t N, std::size_t D>
constexpr std::size_t output_size (std::size_t n)
 Calculates the size of the buffer required for the output, rounding up.
 
bool cmd_encode (EncodeFunc auto f)
 
bool cmd_decode (DecodeFunc auto f)
 
bool cmd_main (const char **argv, EncodeFunc auto ef, DecodeFunc auto df)
 
template<typename T >
bool cmd_main (const char **argv)
 

Variables

constexpr std::size_t BUF_SIZE = 32 * 1024
 Number of 3- or 4-byte blocks in the input buffer.
 

Macro Definition Documentation

◆ BASE64_MAIN

#define BASE64_MAIN ( T)     int main(int, const char **argv) { return !cmd_main<T>(argv); }

Function Documentation

◆ cmd_decode()

bool cmd_decode ( DecodeFunc auto f)
inline
Here is the call graph for this function:

◆ cmd_encode()

bool cmd_encode ( EncodeFunc auto f)
inline
Here is the call graph for this function:

◆ cmd_main() [1/2]

template<typename T >
bool cmd_main ( const char ** argv)
Here is the call graph for this function:

◆ cmd_main() [2/2]

bool cmd_main ( const char ** argv,
EncodeFunc auto ef,
DecodeFunc auto df )
inline

◆ output_size()

template<std::size_t N, std::size_t D>
std::size_t output_size ( std::size_t n)
inlineconstexpr

Calculates the size of the buffer required for the output, rounding up.

Template Parameters
Noutput block size.
Dinput block size.
Parameters
nsize of the input.

◆ round_to_block_size()

template<auto S, std::integral T>
T round_to_block_size ( T n)
inlineconstexpr

Rounds an integral value to a given block size, always towards infinity.

Variable Documentation

◆ BUF_SIZE

std::size_t BUF_SIZE = 32 * 1024
constexpr

Number of 3- or 4-byte blocks in the input buffer.