Debian Codegraph @

src/plugins/schedulers/tj/taskjuggler/FlagList.h

raw
1 /*
2 * ResourceList.h - TaskJuggler
3 *
4 * SPDX-FileCopyrightText: 2001, 2002, 2003, 2004 Chris Schlaeger <[email protected]>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
9 *
10 * $Id$
11 */
12
13 #ifndef _FlagList_h_
14 #define _FlagList_h_
15
16 #include "QStringList"
17
18 namespace TJ
19 {
20
21 class FlagList : public QStringList
22 {
23 public:
24 FlagList() { }
25 virtual ~FlagList() { }
26
27 void addFlag(QString flag)
28 {
29 if (!hasFlag(flag))
30 append(flag);
31 }
32 void clearFlag(const QString& flag)
33 {
34 if (contains(flag)) {
35 removeAt(indexOf(flag));
36 }
37 }
38 bool hasFlag(const QString& flag) const
39 {
40 return contains(flag) > 0;
41 }
42 } ;
43
44 } // namespace TJ
45
46 #endif