Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
#include <iostream>
auto main(int argc, const char** argv) -> int {
for(auto& arg : args) {
if(!arg.starts_with("-")) {
if(arg.prev().is_tag("-f", "--file")) {
std::cout << arg <<
'|' <<
bindump(fc.
block()) << std::endl;
} else if(arg.prev().is_tag("-s", "--string")) {
std::cout << arg <<
'|' <<
bindump(arg.block()) << std::endl;
}
}
}
if(i < 256) {
return {
byte(i++),
true};
}
return {};
};
auto put = [](char c) {
std::cout << c;
return true;
};
return 0;
}
Class providing access to the contents of a file.
Definition: file_contents.hpp:30
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
Common code is placed in this namespace.
Definition: eagine.hpp:21
auto block() const noexcept -> memory::const_block
Returns the block viewing the loaded file contents.
Definition: file_contents.hpp:52
Primary template for conditionally valid values.
Definition: decl.hpp:49
static void apply(byte_getter get_byte, char_putter put_char)
Uses get_byte to read input bytes, encodes them and calls put_char.
unsigned char byte
Byte type alias.
Definition: types.hpp:24
Class wrapping the main function arguments, providing a convenient API.
Definition: program_args.hpp:1082
Class for encoding byte blocks into binary format.
Definition: bindump.hpp:27