OpenWalnut  1.4.0
WPropertyHelper.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WPROPERTYHELPER_H
26 #define WPROPERTYHELPER_H
27 
28 #ifndef Q_MOC_RUN
29 #include <boost/shared_ptr.hpp>
30 #endif
31 
32 #include "WPropertyVariable.h"
33 
34 #include "constraints/WPropertyConstraintNotEmpty.h"
35 #include "constraints/WPropertyConstraintPathExists.h"
36 #include "constraints/WPropertyConstraintIsDirectory.h"
37 #include "constraints/WPropertyConstraintSelectOnlyOne.h"
38 #include "constraints/WPropertyConstraintIsValid.h"
39 
40 
41 /**
42  * This namespace contains several utility functions to handle properties. Especially constraint helper to easily create constraints.
43  */
44 namespace WPropertyHelper
45 {
46  /**
47  * Contains functions for easily adding constraints of type PC_SELECTONLYONE to properties compatible with this constraint.
48  */
49  namespace PC_SELECTONLYONE
50  {
51  /**
52  * Add the PC_SELECTONLYONE constraint to the property.
53  *
54  * \param prop the property where to add the constraint.
55  */
56  void addTo( WPropSelection prop );
57  }
58 
59  /**
60  * Contains functions for easily adding constraints of type PC_NOTEMPTY to properties compatible with this constraint.
61  */
62  namespace PC_NOTEMPTY
63  {
64  /**
65  * Add the PC_NOTEMPTY constraint to the property.
66  *
67  * \param prop the property where to add the constraint.
68  */
69  void addTo( WPropSelection prop );
70 
71  /**
72  * Add the PC_NOTEMPTY constraint to the property.
73  *
74  * \param prop the property where to add the constraint.
75  */
76  void addTo( WPropString prop );
77 
78  /**
79  * Add the PC_NOTEMPTY constraint to the property.
80  *
81  * \param prop the property where to add the constraint.
82  */
83  void addTo( WPropFilename prop );
84  }
85 
86  /**
87  * Contains functions for easily adding constraints of type PC_PATHEXISTS to properties compatible with this constraint.
88  */
89  namespace PC_PATHEXISTS
90  {
91  /**
92  * Add the PC_PATHEXISTS constraint to the property.
93  *
94  * \param prop the property where to add the constraint.
95  */
96  void addTo( WPropFilename prop );
97  }
98 
99  /**
100  * Contains functions for easily adding constraints of type PC_ISDIRECTORY to properties compatible with this constraint.
101  */
102  namespace PC_ISDIRECTORY
103  {
104  /**
105  * Add the PC_PATHEXISTS constraint to the property.
106  *
107  * \param prop the property where to add the constraint.
108  */
109  void addTo( WPropFilename prop );
110  }
111 
112  /**
113  * Contains functions for easily adding constraints of type PC_ISVALID to properties compatible with this constraint.
114  */
115  namespace PC_ISVALID
116  {
117  /**
118  * Add the PC_ISVALID constraint to the property.
119  *
120  * \param prop the property where to add the constraint.
121  */
122  void addTo( WPropSelection prop );
123  }
124 }
125 
126 #endif // WPROPERTYHELPER_H
127 
void addTo(WPropFilename prop)
Add the PC_PATHEXISTS constraint to the property.
This namespace contains several utility functions to handle properties.
void addTo(WPropFilename prop)
Add the PC_PATHEXISTS constraint to the property.
void addTo(WPropSelection prop)
Add the PC_NOTEMPTY constraint to the property.
void addTo(WPropSelection prop)
Add the PC_ISVALID constraint to the property.
void addTo(WPropSelection prop)
Add the PC_SELECTONLYONE constraint to the property.