📄 main.cpp
字号:
// main.cpp
// Autor Konstantin Pilipchuk
// mailto:lostd@ukr.net
//
#include "../base64.hpp"
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int _State = 0;
base64<char> encoder;
{
// encode from cin ...
istream& istr = cin;
istreambuf_iterator<char> _From(istr.rdbuf());
istreambuf_iterator<char> _To(0);
// ... to output file
ofstream ostr("test_out.txt");
ostreambuf_iterator<char> _Out(ostr);
encoder.put(_From, _To, _Out, _State, base64<>::crlf());
}
{ // decode from file ...
ifstream istr("test_out.txt");
istreambuf_iterator<char> _From(istr.rdbuf());
istreambuf_iterator<char> _To(0);
// ... to console
ostreambuf_iterator<char> _Out(cout);
encoder.get(_From, _To, _Out, _State);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -