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@supagro.inra.fr>
37  */
38 
39 #include <openfluid/dllexport.hpp>
40 #include <openfluid/ware/TypeDefs.hpp>
42 
43 
44 #ifndef __OPENFLUID_WARE_WARESIGNATURE_HPP__
45 #define __OPENFLUID_WARE_WARESIGNATURE_HPP__
46 
47 
48 namespace openfluid { namespace ware {
49 
50 
52 {
53  public:
54 
55  typedef std::vector<std::pair<std::string,std::string> > AuthorsList_t;
56 
58 
60 
61  std::string Description;
62 
63  /**
64  Version number
65  */
67 
68  /**
69  Development status
70  */
72 
73  /**
74  ABI version number used to build the ware
75  */
77 
78  /**
79  Authors as a list of pairs [name,email]
80  */
81  AuthorsList_t Authors;
82 
83 
84  // =====================================================================
85  // =====================================================================
86 
87 
89  {
90  clear();
91  }
92 
93 
94  // =====================================================================
95  // =====================================================================
96 
97 
98  void clear()
99  {
100  ID.clear();
101  Name.clear();
102  Description.clear();
103  Version.clear();
105  ABIVersion.clear();
106  Authors.clear();
107  }
108 
109 
110  // =====================================================================
111  // =====================================================================
112 
113 
114  virtual ~WareSignature()
115  { }
116 
117 
118  // =====================================================================
119  // =====================================================================
120 
121 
123  {
124  ABIVersion = Version;
125  }
126 
127 
128  // =====================================================================
129  // =====================================================================
130 
131 
132  std::string getAuthorsAsString() const
133  {
134  std::string Str = "";
135 
136  for (openfluid::ware::WareSignature::AuthorsList_t::const_iterator it = Authors.begin(); it != Authors.end();++it)
137  {
138  if (it != Authors.begin())
139  Str+= ", ";
140 
141  Str += openfluid::tools::replaceEmptyString((*it).first,("(unknown author)"));
142  Str += " <";
143  Str += openfluid::tools::replaceEmptyString((*it).second,("(unknown author email)"));
144  Str += ">";
145  }
146  return Str;
147  }
148 
149 
150 };
151 
152 
153 
154 } } // openfluid::ware
155 
156 
157 
158 #endif /* __OPENFLUID_WARE_WARESIGNATURE_HPP__ */
virtual ~WareSignature()
Definition: WareSignature.hpp:114
std::vector< std::pair< std::string, std::string > > AuthorsList_t
Definition: WareSignature.hpp:55
std::string getAuthorsAsString() const
Definition: WareSignature.hpp:132
Definition: TypeDefs.hpp:108
std::string WareName_t
Definition: TypeDefs.hpp:52
std::string WareID_t
Definition: TypeDefs.hpp:50
WareStatus_t Status
Definition: WareSignature.hpp:71
WareID_t ID
Definition: WareSignature.hpp:57
std::string OPENFLUID_API replaceEmptyString(std::string SourceStr, const std::string &ReplaceStr)
AuthorsList_t Authors
Definition: WareSignature.hpp:81
WareVersion_t ABIVersion
Definition: WareSignature.hpp:76
std::string WareVersion_t
Definition: TypeDefs.hpp:54
WareStatus_t
Definition: TypeDefs.hpp:103
WareName_t Name
Definition: WareSignature.hpp:59
Definition: ApplicationException.hpp:47
#define OPENFLUID_API
Definition: dllexport.hpp:87
WareSignature()
Definition: WareSignature.hpp:88
WareVersion_t Version
Definition: WareSignature.hpp:66
Definition: WareSignature.hpp:51
std::string Description
Definition: WareSignature.hpp:61
void setABIVersion(WareVersion_t Version)
Definition: WareSignature.hpp:122
void clear()
Definition: WareSignature.hpp:98