2 Bacula® - The Network Backup Solution
4 Copyright (C) 2011-2014 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from many
7 others, a complete list can be found in the file AUTHORS.
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.
14 Bacula® is a registered trademark of Kern Sibbald.
17 * Kern Sibbald, January MMXII
19 * Selection list. A string of integers separated by commas
20 * representing items selected. Ranges of the form nn-mm
28 * Loop var through each member of list
30 #define foreach_sellist(var, list) \
31 for((var)=(list)->first(); (var)>=0; (var)=(list)->next() )
34 class sellist : public SMARTALLOC {
46 bool set_string(const char *string, bool scan);
47 bool is_all() { return all; };
51 /* size() valid only if scan enabled on string */
52 int size() const { return num_items; };
53 char *get_list() { return str; };
54 /* get the list of all jobids */
55 char *get_expanded_list();
56 /* if errmsg == NULL, no error */
57 const char *get_errmsg() { return errmsg; };
61 * Initialize the list structure
63 inline sellist::sellist()
75 inline sellist::~sellist()
89 * error if returns -1 and errmsg set
90 * end of items if returns -1 and errmsg NULL
92 inline int64_t sellist::first()
99 * Reset to walk list from beginning
101 inline void sellist::begin()
110 #endif /* __SELLIST_H_ */