btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / bin / package / PackageWriterListener.cpp
blob0ab1374955365fc78088c02978688b40eceae6d0
1 /*
2 * Copyright 2009-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
4 * Distributed under the terms of the MIT License.
5 */
8 #include "PackageWriterListener.h"
10 #include <stdio.h>
13 using BPackageKit::BHPKG::BPackageWriterListener;
14 using BPackageKit::BHPKG::BPackageWriter;
17 PackageWriterListener::PackageWriterListener(bool verbose, bool quiet)
19 fVerbose(verbose), fQuiet(quiet)
24 void
25 PackageWriterListener::PrintErrorVarArgs(const char* format, va_list args)
27 vfprintf(stderr, format, args);
31 void
32 PackageWriterListener::OnEntryAdded(const char* path)
34 if (fQuiet || !fVerbose)
35 return;
37 printf("\t%s\n", path);
41 void
42 PackageWriterListener::OnTOCSizeInfo(uint64 uncompressedStringsSize,
43 uint64 uncompressedMainSize, uint64 uncompressedTOCSize)
45 if (fQuiet || !fVerbose)
46 return;
48 printf("----- TOC Info -----------------------------------\n");
49 printf("cached strings size: %10" B_PRIu64 " (uncompressed)\n",
50 uncompressedStringsSize);
51 printf("TOC main size: %10" B_PRIu64 " (uncompressed)\n",
52 uncompressedMainSize);
53 printf("total TOC size: %10" B_PRIu64 " (uncompressed)\n",
54 uncompressedTOCSize);
58 void
59 PackageWriterListener::OnPackageAttributesSizeInfo(uint32 stringCount,
60 uint32 uncompressedSize)
62 if (fQuiet || !fVerbose)
63 return;
65 printf("----- Package Attribute Info ---------------------\n");
66 printf("string count: %10" B_PRIu32 "\n", stringCount);
67 printf("package attributes size: %10" B_PRIu32 " (uncompressed)\n",
68 uncompressedSize);
72 void
73 PackageWriterListener::OnPackageSizeInfo(uint32 headerSize, uint64 heapSize,
74 uint64 tocSize, uint32 packageAttributesSize, uint64 totalSize)
76 if (fQuiet)
77 return;
79 printf("----- Package Info ----------------\n");
80 printf("header size: %10" B_PRIu32 "\n", headerSize);
81 printf("heap size: %10" B_PRIu64 "\n", heapSize);
82 printf("TOC size: %10" B_PRIu64 "\n", tocSize);
83 printf("package attributes size: %10" B_PRIu32 "\n",
84 packageAttributesSize);
85 printf("total size: %10" B_PRIu64 "\n", totalSize);
86 printf("-----------------------------------\n");