OpenWalnut  1.5.0dev
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 #include <memory>
29 
30 
31 #include "WPropertyVariable.h"
32 #include "constraints/WPropertyConstraintConfirmOverwrite.h"
33 #include "constraints/WPropertyConstraintIsDirectory.h"
34 #include "constraints/WPropertyConstraintIsValid.h"
35 #include "constraints/WPropertyConstraintNotEmpty.h"
36 #include "constraints/WPropertyConstraintPathExists.h"
37 #include "constraints/WPropertyConstraintSelectOnlyOne.h"
38 
39 
40 /**
41  * This namespace contains several utility functions to handle properties. Especially constraint helper to easily create constraints.
42  */
43 namespace WPropertyHelper
44 {
45  /**
46  * Contains functions for easily adding constraints of type PC_SELECTONLYONE to properties compatible with this constraint.
47  */
48  namespace PC_SELECTONLYONE
49  {
50  /**
51  * Add the PC_SELECTONLYONE constraint to the property.
52  *
53  * \param prop the property where to add the constraint.
54  */
55  void addTo( WPropSelection prop );
56  }
57 
58  /**
59  * Contains functions for easily adding constraints of type PC_NOTEMPTY to properties compatible with this constraint.
60  */
61  namespace PC_NOTEMPTY
62  {
63  /**
64  * Add the PC_NOTEMPTY constraint to the property.
65  *
66  * \param prop the property where to add the constraint.
67  */
68  void addTo( WPropSelection prop );
69 
70  /**
71  * Add the PC_NOTEMPTY constraint to the property.
72  *
73  * \param prop the property where to add the constraint.
74  */
75  void addTo( WPropString prop );
76 
77  /**
78  * Add the PC_NOTEMPTY constraint to the property.
79  *
80  * \param prop the property where to add the constraint.
81  */
82  void addTo( WPropFilename prop );
83  }
84 
85  /**
86  * Contains functions for easily adding constraints of type PC_PATHEXISTS to properties compatible with this constraint.
87  */
88  namespace PC_PATHEXISTS
89  {
90  /**
91  * Add the PC_PATHEXISTS constraint to the property.
92  *
93  * \param prop the property where to add the constraint.
94  */
95  void addTo( WPropFilename prop );
96  }
97 
98  /**
99  * Contains functions for easily adding constraints of type PC_ISDIRECTORY to properties compatible with this constraint.
100  */
101  namespace PC_ISDIRECTORY
102  {
103  /**
104  * Add the PC_PATHEXISTS constraint to the property.
105  *
106  * \param prop the property where to add the constraint.
107  */
108  void addTo( WPropFilename prop );
109  }
110 
111  /**
112  * Contains functions for easily adding contraints of type PC_CONFIRMOVERWRITE to properties compatible with this constraint.
113  */
114  namespace PC_CONFIRMOVERWRITE
115  {
116  /**
117  * Add the PC_CONFIRMOVERWRITE constraint to the property.
118  *
119  * \param prop the property where to add the constraint.
120  */
121  void addTo( WPropFilename prop );
122  }
123 
124  /**
125  * Contains functions for easily adding constraints of type PC_ISVALID to properties compatible with this constraint.
126  */
127  namespace PC_ISVALID
128  {
129  /**
130  * Add the PC_ISVALID constraint to the property.
131  *
132  * \param prop the property where to add the constraint.
133  */
134  void addTo( WPropSelection prop );
135  }
136 }
137 
138 #endif // WPROPERTYHELPER_H
139 
void addTo(WPropFilename prop)
Add the PC_CONFIRMOVERWRITE constraint to the property.
void addTo(WPropFilename prop)
Add the PC_PATHEXISTS constraint to the property.
void addTo(WPropSelection prop)
Add the PC_ISVALID constraint to the property.
void addTo(WPropSelection prop)
Add the PC_NOTEMPTY constraint to the property.
void addTo(WPropFilename prop)
Add the PC_PATHEXISTS constraint to the property.
void addTo(WPropSelection prop)
Add the PC_SELECTONLYONE constraint to the property.
This namespace contains several utility functions to handle properties.