2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2016 Kern Sibbald
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.
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 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
20 * Kern Sibbald, January MMXII
22 * Selection list. A string of integers separated by commas
23 * representing items selected. Ranges of the form nn-mm
31 * Loop var through each member of list
33 #define foreach_sellist(var, list) \
34 for((var)=(list)->first(); (var)>=0; (var)=(list)->next() )
37 class sellist : public SMARTALLOC {
49 bool set_string(const char *string, bool scan);
50 bool is_all() { return all; };
54 /* size() valid only if scan enabled on string */
55 int size() const { return num_items; };
56 char *get_list() { return str; };
57 /* get the list of all jobids */
58 char *get_expanded_list();
59 /* if errmsg == NULL, no error */
60 const char *get_errmsg() { return errmsg; };
64 * Initialize the list structure
66 inline sellist::sellist()
78 inline sellist::~sellist()
92 * error if returns -1 and errmsg set
93 * end of items if returns -1 and errmsg NULL
95 inline int64_t sellist::first()
102 * Reset to walk list from beginning
104 inline void sellist::begin()
113 #endif /* __SELLIST_H_ */