]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/findlib/win32filter.h
048ce9406a8f4ef41f3f020784510adf62776981
[bacula/bacula] / bacula / src / findlib / win32filter.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2015 Kern Sibbald
5
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    This notice must be preserved when any source code is 
15    conveyed and/or propagated.
16
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19
20 #ifndef WIN32FILTER_H
21 #define WIN32FILTER_H
22
23 #include "bacula.h"
24 #include "bfile.h"      /* for BWIN32_STREAM_ID */
25
26 class Win32Filter
27 {
28 public:
29    int64_t skip_size;   /* how many bytes we have to skip before next header */
30    int64_t data_size;   /* how many data are expected in the stream */
31    int     header_pos;  /* the part of the header that was filled in by previous record */
32
33    BWIN32_STREAM_ID header;
34
35    Win32Filter() {
36       init();
37    };
38    
39    void init() {
40       skip_size = 0;
41       data_size = 0;
42       header_pos = 0;
43    };
44
45    void copy(Win32Filter *f)
46    {
47       skip_size = f->skip_size;
48       data_size = f->data_size;
49       header_pos = f->header_pos;
50       header = f->header;
51    };
52
53    /* If the stream is HHHDDDDD, you can call  have_data("HHHDDDDD", 8, <not used>)
54     * and it will return  "DDDDD", 0, 5
55     */
56    bool have_data(char **raw, int64_t *raw_len, int64_t *data_len);
57 };
58
59 #endif