WareSignature.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  @file WareSignature.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
38 
39 
40 #include <openfluid/dllexport.hpp>
41 #include <openfluid/ware/TypeDefs.hpp>
43 
44 
45 #ifndef __OPENFLUID_WARE_WARESIGNATURE_HPP__
46 #define __OPENFLUID_WARE_WARESIGNATURE_HPP__
47 
48 
49 namespace openfluid { namespace ware {
50 
51 
53 {
54  public:
55 
56  typedef std::vector<std::pair<std::string,std::string> > AuthorsList_t;
57 
59 
61 
62  std::string Description;
63 
64  /**
65  Version number
66  */
68 
69  /**
70  Development status
71  */
73 
74  /**
75  ABI version number used to build the ware
76  */
78 
79  /**
80  Authors as a list of pairs [name,email]
81  */
82  AuthorsList_t Authors;
83 
84 
85  // =====================================================================
86  // =====================================================================
87 
88 
90  {
91  clear();
92  }
93 
94 
95  // =====================================================================
96  // =====================================================================
97 
98 
99  void clear()
100  {
101  ID.clear();
102  Name.clear();
103  Description.clear();
104  Version.clear();
106  ABIVersion.clear();
107  Authors.clear();
108  }
109 
110 
111  // =====================================================================
112  // =====================================================================
113 
114 
115  virtual ~WareSignature()
116  { }
117 
118 
119  // =====================================================================
120  // =====================================================================
121 
122 
124  {
125  ABIVersion = Version;
126  }
127 
128 
129  // =====================================================================
130  // =====================================================================
131 
132 
133  std::string getAuthorsAsString() const
134  {
135  std::string Str = "";
136 
137  for (openfluid::ware::WareSignature::AuthorsList_t::const_iterator it = Authors.begin(); it != Authors.end();++it)
138  {
139  if (it != Authors.begin())
140  Str+= ", ";
141 
142  Str += openfluid::tools::replaceEmptyString((*it).first,("(unknown author)"));
143  Str += " <";
144  Str += openfluid::tools::replaceEmptyString((*it).second,("(unknown author email)"));
145  Str += ">";
146  }
147  return Str;
148  }
149 
150 
151 };
152 
153 
154 } } // openfluid::ware
155 
156 
157 #endif /* __OPENFLUID_WARE_WARESIGNATURE_HPP__ */
WareSignature()
Definition: WareSignature.hpp:89
Definition: WareSignature.hpp:52
std::string WareName_t
Definition: TypeDefs.hpp:51
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: TypeDefs.hpp:106
std::vector< std::pair< std::string, std::string > > AuthorsList_t
Definition: WareSignature.hpp:56
Definition: ApplicationException.hpp:47
WareName_t Name
Definition: WareSignature.hpp:60
std::string WareID_t
Definition: TypeDefs.hpp:49
WareID_t ID
Definition: WareSignature.hpp:58
WareStatus_t
Definition: TypeDefs.hpp:101
virtual ~WareSignature()
Definition: WareSignature.hpp:115
WareStatus_t Status
Definition: WareSignature.hpp:72
void clear()
Definition: WareSignature.hpp:99
std::string getAuthorsAsString() const
Definition: WareSignature.hpp:133
WareVersion_t Version
Definition: WareSignature.hpp:67
AuthorsList_t Authors
Definition: WareSignature.hpp:82
std::string WareVersion_t
Definition: TypeDefs.hpp:53
std::string OPENFLUID_API replaceEmptyString(std::string SourceStr, const std::string &ReplaceStr)
std::string Description
Definition: WareSignature.hpp:62
WareVersion_t ABIVersion
Definition: WareSignature.hpp:77
void setABIVersion(WareVersion_t Version)
Definition: WareSignature.hpp:123