ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

car.cpp File Reference
#include <ucommon/secure.h>
#include <sys/stat.h>
Include dependency graph for car.cpp:

Go to the source code of this file.

Enumerations

enum  { d_text, d_file, d_scan, d_init }
 

Functions

static void report (const char *path, int code)
 
static bool encode (const char *path, FILE *fp, size_t offset=0)
 
static void encodestream (void)
 
static void header (void)
 
static void encodefile (const char *path, const char *name)
 
static void final (void)
 
static void process (void)
 
static void binarydecode (FILE *fp, const char *path)
 
static void streamdecode (FILE *fp, const char *path)
 
static void scan (string_t path, string_t prefix)
 
int main (int argc, char **argv)
 

Variables

static shell::flagopt helpflag ('h',"--help", _TEXT("display this list"))
 
static shell::flagopt althelp ('?', NULL, NULL)
 
static shell::stringopt tag ('t', "--tag", _TEXT("tag annotation"), "text", "")
 
static shell::stringopt algo ('c', "--cipher", _TEXT("cipher method (aes256)"), "method", "aes256")
 
static shell::flagopt decode ('d', "--decode", _TEXT("decode archive"))
 
static shell::stringopt hash ('h', "--digest", _TEXT("digest method (sha)"), "method", "sha")
 
static shell::flagopt noheader ('n', "--no-header", _TEXT("without wrapper"))
 
static shell::stringopt out ('o', "--output", _TEXT("output file"), "filename", "-")
 
static shell::flagopt quiet ('q', "--quiet", _TEXT("quiet operation"))
 
static shell::flagopt recursive ('R', "--recursive", _TEXT("recursive directory scan"))
 
static shell::flagopt altrecursive ('r', NULL, NULL)
 
static shell::flagopt hidden ('s', "--hidden", _TEXT("include hidden files"))
 
static shell::flagopt yes ('y', "--overwrite", _TEXT("overwrite existing files"))
 
static bool binary = false
 
static int exit_code = 0
 
static const char * argv0 = "car"
 
static uint8_t frame [48]
 
static uint8_t cbuf [48]
 
static cipher_t cipher
 
static FILE * output = stdout
 
static enum { ... }  decoder = d_init
 
static unsigned frames
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
d_text 
d_file 
d_scan 
d_init 

Definition at line 44 of file car.cpp.

Function Documentation

◆ binarydecode()

static void binarydecode ( FILE *  fp,
const char *  path 
)
static

Definition at line 302 of file car.cpp.

References ucommon::_TEXT(), argv0, buffer, ucommon::eq(), ucommon::shell::errexit(), exit_code, frame, process(), and report().

Referenced by main().

◆ encode()

static bool encode ( const char *  path,
FILE *  fp,
size_t  offset = 0 
)
static

Definition at line 101 of file car.cpp.

References ucommon::String::b64encode(), binary, buffer, cbuf, cipher, frame, output, ucommon::Cipher::put(), and report().

Referenced by encodefile(), and encodestream().

◆ encodefile()

static void encodefile ( const char *  path,
const char *  name 
)
static

◆ encodestream()

static void encodestream ( void  )
static

Definition at line 141 of file car.cpp.

References binary, encode(), frame, ucommon::shell::input(), ucommon::is(), ucommon::fsys::is_tty(), noheader, and output.

Referenced by main().

◆ final()

static void final ( void  )
static

Definition at line 208 of file car.cpp.

References cbuf, cipher, d_init, d_scan, decoder, frame, output, and ucommon::Cipher::put().

◆ header()

static void header ( void  )
static

Definition at line 161 of file car.cpp.

References binary, frame, output, ucommon::String::set(), and tag.

Referenced by ost::MIMEMultipart::getHeaders(), and main().

◆ main()

◆ process()

◆ report()

static void report ( const char *  path,
int  code 
)
static

◆ scan()

static void scan ( string_t  path,
string_t  prefix 
)
static

◆ streamdecode()

static void streamdecode ( FILE *  fp,
const char *  path 
)
static

Variable Documentation

◆ algo

shell::stringopt algo( 'c', "--cipher", _TEXT("cipher method (aes256)"), "method", "aes256")
static

Referenced by main().

◆ althelp

shell::flagopt althelp('?', NULL, NULL)
static

Referenced by main().

◆ altrecursive

shell::flagopt altrecursive( 'r', NULL, NULL)
static

Referenced by scan().

◆ argv0

const char* argv0 = "car"
static

Definition at line 40 of file car.cpp.

Referenced by binarydecode(), main(), process(), report(), and streamdecode().

◆ binary

◆ cbuf

uint8_t cbuf[48]
static

Definition at line 41 of file car.cpp.

Referenced by encode(), encodefile(), final(), main(), process(), ost::IPV4Cidr::set(), and ucommon::cidr::set().

◆ cipher

◆ decode

shell::flagopt decode( 'd', "--decode", _TEXT("decode archive"))
static

Referenced by main().

◆ decoder

enum { ... } decoder

◆ exit_code

int exit_code = 0
static

Definition at line 39 of file car.cpp.

Referenced by binarydecode(), main(), ucommon::shell::release(), report(), and streamdecode().

◆ frame

uint8_t frame[48]
static

Definition at line 41 of file car.cpp.

Referenced by binarydecode(), encode(), encodefile(), encodestream(), final(), header(), process(), and streamdecode().

◆ frames

unsigned frames
static

Definition at line 45 of file car.cpp.

Referenced by process().

◆ hash

shell::stringopt hash( 'h', "--digest", _TEXT("digest method (sha)"), "method", "sha")
static

Referenced by main(), and sha2_begin().

◆ helpflag

shell::flagopt helpflag( 'h',"--help", _TEXT("display this list"))
static

Referenced by main().

◆ hidden

shell::flagopt hidden( 's', "--hidden", _TEXT("include hidden files"))
static

Referenced by scan().

◆ noheader

shell::flagopt noheader( 'n', "--no-header", _TEXT("without wrapper"))
static

Referenced by encodestream(), and main().

◆ out

◆ output

FILE* output = stdout
static

◆ quiet

shell::flagopt quiet( 'q', "--quiet", _TEXT("quiet operation"))
static

Referenced by process().

◆ recursive

shell::flagopt recursive( 'R', "--recursive", _TEXT("recursive directory scan"))
static

Referenced by scan().

◆ tag

shell::stringopt tag( 't', "--tag", _TEXT("tag annotation"), "text", "")
static

Referenced by header(), and main().

◆ yes

shell::flagopt yes( 'y', "--overwrite", _TEXT("overwrite existing files"))
static

Referenced by process().