diff options
author | adlr@google.com <adlr@google.com@06c00378-0e64-4dae-be16-12b19f9950a1> | 2009-12-04 20:57:17 +0000 |
---|---|---|
committer | adlr@google.com <adlr@google.com@06c00378-0e64-4dae-be16-12b19f9950a1> | 2009-12-04 20:57:17 +0000 |
commit | 3defe6acb3609e70e851a6eff062577d25a2af9d (patch) | |
tree | 341e979027fde117dd8906483db7a5c703a2e1cf /gzip.h | |
parent | c98a7edf648aad88b3f66df3b5a7d43d6a6d7fa9 (diff) |
Missed new files in last commit
Review URL: http://codereview.chromium.org/465067
git-svn-id: svn://chrome-svn/chromeos/trunk@336 06c00378-0e64-4dae-be16-12b19f9950a1
Diffstat (limited to 'gzip.h')
-rw-r--r-- | gzip.h | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <string> +#include <vector> + +namespace chromeos_update_engine { + +// Gzip compresses or decompresses the input to the output. +// Returns true on success. If true, *out will point to a malloc()ed +// buffer, which must be free()d by the caller. +bool GzipCompressData(const char* const in, const size_t in_size, + char** out, size_t* out_size); +bool GzipDecompressData(const char* const in, const size_t in_size, + char** out, size_t* out_size); + +// Helper functions: +bool GzipDecompress(const std::vector<char>& in, std::vector<char>* out); +bool GzipCompress(const std::vector<char>& in, std::vector<char>* out); +bool GzipCompressString(const std::string& str, std::vector<char>* out); +bool GzipDecompressString(const std::string& str, std::vector<char>* out); + +} // namespace chromeos_update_engine { |