win: winmain, manifest, icon, and some improvements

This commit is contained in:
Ondrej Novak 2025-02-08 12:42:55 +01:00
parent f70b29abab
commit 7bea57e587
23 changed files with 203 additions and 140 deletions

20
libs/file_to_base64.cpp Normal file
View file

@ -0,0 +1,20 @@
#include "base64.h"
#include <iostream>
#include <fstream>
int main(int argc, char **argv) {
if (argc != 2) {
std::cerr << "Requires name of the file" << std::endl;
return 1;
}
std::ifstream input(argv[1], std::ios::in|std::ios::binary);
if (!input) {
std::cerr << "Failed to open:" << argv[1] << std::endl;
}
auto in_iter = std::istream_iterator<char>(input);
auto in_end = std::istream_iterator<char>();
auto out_iter = std::ostream_iterator<char>(std::cout);
base64.encode(in_iter, in_end, out_iter);
return 0;
}