bump product version to 4.1.6.2
[LibreOffice.git] / extensions / source / update / tools / ztool.cxx
blob7009d483c627372f24f59814f040605bad44f833
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <stdio.h>
22 #include <tools/stream.hxx>
23 #include <tools/zcodec.hxx>
25 void show_usage()
27 fputs("ztool usage: ztool <source> <dest>\n", stderr);
30 int SAL_CALL main( int argc, char **argv )
32 if ( argc != 3 )
34 show_usage();
35 return -1;
37 OUString aInName = OUString::createFromAscii(argv[1]);
38 OUString aOutName = OUString::createFromAscii(argv[2]);
39 SvFileStream aInFile( aInName, STREAM_READ );
40 SvFileStream aOutFile( aOutName, STREAM_WRITE | STREAM_TRUNC );
42 ZCodec aCompressor;
43 aCompressor.BeginCompression();
44 aCompressor.Compress( aInFile, aOutFile );
45 aCompressor.EndCompression();
47 return 0;
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */