FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lif-base64utils/base64encoder/base64encoder.cpp at master · custodian/lif-base64utils · GitHub
custodian
lif-base64utils
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
lif-base64utils
/
base64encoder
/
base64encoder.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
81 lines (67 loc) · 2.03 KB
Breadcrumbs
lif-base64utils
/
base64encoder
/
base64encoder.cpp
Copy path
File metadata and controls
81 lines (67 loc) · 2.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
base64encoder.cpp : Defines the entry point for the application.
//
#
include
"
targetver.h
"
#
include
"
tchar.h
"
#
define
NOMINMAX
#
include
"
windows.h
"
#
include
<
iostream
>
#
include
<
fstream
>
#
include
<
boost/iostreams/copy.hpp
>
#
include
<
boost/iostreams/filtering_streambuf.hpp
>
#
include
<
boost/iostreams/filtering_stream.hpp
>
#
include
<
boost/iostreams/filter/gzip.hpp
>
using
namespace
boost
::iostreams
;
#
include
<
boost/archive/iterators/base64_from_binary.hpp
>
#
include
<
boost/archive/iterators/insert_linebreaks.hpp
>
#
include
<
boost/archive/iterators/transform_width.hpp
>
#
include
<
boost/archive/iterators/ostream_iterator.hpp
>
using
namespace
boost
::archive::iterators
;
using
namespace
std
;
typedef
insert_linebreaks<
base64_from_binary<
transform_width<
istreambuf_iterator<
char
>,
6
,
8
>
>
,
50002
>
t_b64_from_bin;
int
APIENTRY
_tWinMain
(
HINSTANCE
hInstance,
HINSTANCE
hPrevInstance,
LPTSTR
lpCmdLine,
int
nCmdShow
)
{
int
argc =
0
;
TCHAR
** argv =
CommandLineToArgvW
(lpCmdLine, &argc);
if
(argc <
2
) {
cout <<
"
Usage: input output gzip
"
;
return
-
1
;
}
fstream fsin;
fsin.
open
(argv[
0
], ios::binary | ios::in);
if
(!fsin.
is_open
()) {
cout <<
"
Error opening input file:
"
<< argv[
0
];
return
-
1
;
}
fstream fsout;
fsout.
open
(argv[
1
], ios::binary | ios::out);
if
(!fsout.
is_open
()) {
cout <<
"
Error opening output file:
"
<< argv[
1
];
return
-
1
;
}
filtering_stream<input> in_data;
in_data.
push
(
gzip_compressor
(gzip::default_compression,
64000
));
in_data.
push
(fsin);
//
string data((istreambuf_iterator<char>(in_data)), istreambuf_iterator<char>());
copy
(
t_b64_from_bin
(istreambuf_iterator<
char
>(in_data)),
t_b64_from_bin
(istreambuf_iterator<
char
>()),
std::ostream_iterator<
char
>(fsout)
);
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL