GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/upload_spooler_result.h
Date: 2024-04-28 02:33:07
Exec Total Coverage
Lines: 6 7 85.7%
Branches: 1 2 50.0%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #ifndef CVMFS_UPLOAD_SPOOLER_RESULT_H_
6 #define CVMFS_UPLOAD_SPOOLER_RESULT_H_
7
8 #include <string>
9
10 #include "compression.h"
11 #include "file_chunk.h"
12
13 namespace upload {
14
15 /**
16 * This data structure will be passed to every callback spoolers will invoke.
17 * It encapsulates the results of a spooler command along with the given
18 * local_path to identify the spooler action performed.
19 *
20 * Note: When the return_code is different from 0 the content_hash is most
21 * likely undefined, Null or rubbish.
22 */
23 struct SpoolerResult {
24 250094 explicit SpoolerResult(
25 const int return_code = -1,
26 const std::string &local_path = "",
27 const shash::Any &digest = shash::Any(),
28 const FileChunkList &file_chunks = FileChunkList(),
29 const zlib::Algorithms compression_alg = zlib::kZlibDefault)
30 250094 : return_code(return_code)
31 250094 , local_path(local_path)
32 250096 , content_hash(digest)
33
1/2
✓ Branch 1 taken 250099 times.
✗ Branch 2 not taken.
250096 , file_chunks(file_chunks)
34 250099 , compression_alg(compression_alg) {}
35
36 inline bool IsChunked() const { return !file_chunks.IsEmpty(); }
37
38 int return_code; //!< the return value of the spooler operation
39 std::string local_path; //!< the local_path previously given as input
40 /**
41 * The content_hash of the bulk file derived during processing
42 */
43 shash::Any content_hash;
44 FileChunkList file_chunks; //!< the file chunks generated during processing
45 zlib::Algorithms compression_alg;
46 };
47
48 } // namespace upload
49
50 #endif // CVMFS_UPLOAD_SPOOLER_RESULT_H_
51