CCSDS 124.0-B-1 C++ 1.0.0
CCSDS 124.0-B-1 Lossless Compression
Loading...
Searching...
No Matches
cli.cpp File Reference

CCSDS 124.0-B-1 C++ command line interface. More...

#include <ccsds124/ccsds124.hpp>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <vector>
Include dependency graph for cli.cpp:

Go to the source code of this file.

Functions

static void print_version ()
 
static void print_help (const char *prog_name)
 
static std::string make_decompress_filename (const std::string &input)
 
static std::vector< std::uint8_t > read_file (const std::string &path)
 
static bool write_file (const std::string &path, const std::uint8_t *data, std::size_t size)
 
static int do_compress (const char *input_path, int packet_size, int pt_period, int ft_period, int rt_period, int robustness)
 
static int do_decompress (const char *input_path, int packet_size, int robustness)
 
int main (int argc, char **argv)
 

Variables

static constexpr const char * BANNER
 

Detailed Description

CCSDS 124.0-B-1 C++ command line interface.

Definition in file cli.cpp.

Function Documentation

◆ do_compress()

static int do_compress ( const char *  input_path,
int  packet_size,
int  pt_period,
int  ft_period,
int  rt_period,
int  robustness 
)
static

Definition at line 117 of file cli.cpp.

References read_file(), and write_file().

Referenced by main().

◆ do_decompress()

static int do_decompress ( const char *  input_path,
int  packet_size,
int  robustness 
)
static

Definition at line 175 of file cli.cpp.

References make_decompress_filename(), read_file(), and write_file().

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 227 of file cli.cpp.

References do_compress(), do_decompress(), print_help(), and print_version().

◆ make_decompress_filename()

static std::string make_decompress_filename ( const std::string &  input)
static

Definition at line 83 of file cli.cpp.

Referenced by do_decompress().

◆ print_help()

static void print_help ( const char *  prog_name)
static

Definition at line 50 of file cli.cpp.

References BANNER, and ccsds124::version().

Referenced by main().

◆ print_version()

static void print_version ( )
static

Definition at line 46 of file cli.cpp.

References ccsds124::version().

Referenced by main().

◆ read_file()

static std::vector< std::uint8_t > read_file ( const std::string &  path)
static

Definition at line 91 of file cli.cpp.

Referenced by do_compress(), and do_decompress().

◆ write_file()

static bool write_file ( const std::string &  path,
const std::uint8_t *  data,
std::size_t  size 
)
static

Definition at line 108 of file cli.cpp.

Referenced by do_compress(), and do_decompress().

Variable Documentation

◆ BANNER

constexpr const char* BANNER
staticconstexpr
Initial value:
= " \n"
" \n"
" ____ ____ ____ ____ ____ _ ____ _ _ \n"
" / ___/ ___/ ___|| _ \\/ ___| / |___ \\| || | \n"
"| | | | \\___ \\| | | \\___ \\ | | __) | || |_ \n"
"| |__| |___ ___) | |_| |___) | | |/ __/|__ _| \n"
" \\____\\____|____/|____/|____/ |_|_____| |_| \n"
" \n"
" by T A N A G R A S P A C E \n"
" \n"

Definition at line 35 of file cli.cpp.

Referenced by print_help().