tobicore  7.0.0
 All Classes Functions Variables Typedefs Enumerator Friends Groups Pages
TCLanguage.hpp
1 /*
2  Copyright (C) 2009-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
3  Michele Tavella <michele.tavella@epfl.ch>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef TCLANGUAGE_HPP
20 #define TCLANGUAGE_HPP
21 
22 #include "TCBlock.hpp"
23 #include <string>
24 
29 class TCLanguage {
30  public:
38  std::string Status(const int component, const int status,
39  const int fidx = TCBlock::BlockIdxUnset);
40 
48  bool CheckVersion(const std::string& message);
49 
57  bool IsStatus(const std::string& message, int* component, int* status,
58  int* fidx);
59 
67  std::string GetComponent(int component);
68 
76  std::string GetStatus(int component);
77 
78  public:
79  /*
81  enum { IA, IB, IC, ID, Otherwise };
82 
84  enum { Ready = 0, Quit, ErrorGeneric, ErrorNotSupported };
85  */
86 
88  const static int IA = 1;
89 
91  const static int IB = 2;
92 
94  const static int IC = 3;
95 
97  const static int ID = 4;
98 
100  const static int Ready = 1;
101 
103  const static int Quit = 2;
104 
106  const static int ErrorGeneric = -1;
107 
109  const static int ErrorNotSupported = -2;
110 };
111 
112 #endif