Bladeren bron

moved version to libnfcbusiness

develop
Robin Thoni 9 jaren geleden
bovenliggende
commit
5798589003
3 gewijzigde bestanden met toevoegingen van 22 en 15 verwijderingen
  1. 2
    13
      cli/Interface/MainClass.cpp
  2. 17
    1
      src/Business/LibNfcBusiness.cpp
  3. 3
    1
      src/Business/LibNfcBusiness.h

+ 2
- 13
cli/Interface/MainClass.cpp Bestand weergeven

19
 {
19
 {
20
 }
20
 }
21
 
21
 
22
-#define Q(x) #x
23
-#define QUOTE(x) Q(x)
24
-
25
-#ifndef GIT_SHA1
26
-#define GIT_SHA1 "unknown"
27
-#endif
28
-
29
-#ifndef GIT_REF_NAME
30
-#define GIT_REF_NAME "unknown"
31
-#endif
32
-
33
 int MainClass::main()
22
 int MainClass::main()
34
 {
23
 {
35
     CommandLineParser parser(_argc, _argv);
24
     CommandLineParser parser(_argc, _argv);
233
 
222
 
234
 void MainClass::printVersion() const
223
 void MainClass::printVersion() const
235
 {
224
 {
236
-    std::cout << "LibNfc version: " << LibNfcBusiness::getVersion() << std::endl;
237
-    std::cout << "Mifare-tools version: " << QUOTE(GIT_REF_NAME) << "-" << QUOTE(GIT_SHA1) << std::endl;
225
+    std::cout << "LibNfc version: " << LibNfcBusiness::getLibNfcVersion() << std::endl;
226
+    std::cout << "Mifare-tools version: " << LibNfcBusiness::getMifareToolsVersion() << std::endl;
238
 }
227
 }
239
 
228
 
240
 std::shared_ptr<NfcDeviceBusiness> MainClass::getDevice(const std::string &deviceName, std::vector<std::shared_ptr<NfcDeviceBusiness>> devices)
229
 std::shared_ptr<NfcDeviceBusiness> MainClass::getDevice(const std::string &deviceName, std::vector<std::shared_ptr<NfcDeviceBusiness>> devices)

+ 17
- 1
src/Business/LibNfcBusiness.cpp Bestand weergeven

5
 #include <algorithm>
5
 #include <algorithm>
6
 #include "LibNfcBusiness.h"
6
 #include "LibNfcBusiness.h"
7
 
7
 
8
+#define Q(x) #x
9
+#define QUOTE(x) Q(x)
10
+
11
+#ifndef GIT_SHA1
12
+#define GIT_SHA1 "unknown"
13
+#endif
14
+
15
+#ifndef GIT_REF_NAME
16
+#define GIT_REF_NAME "unknown"
17
+#endif
18
+
8
 LibNfcBusiness::LibNfcBusiness()
19
 LibNfcBusiness::LibNfcBusiness()
9
 {
20
 {
10
     _libNfc = std::make_shared<LibNfc>();
21
     _libNfc = std::make_shared<LibNfc>();
23
     return _libNfc->init();
34
     return _libNfc->init();
24
 }
35
 }
25
 
36
 
26
-std::string LibNfcBusiness::getVersion()
37
+std::string LibNfcBusiness::getLibNfcVersion()
27
 {
38
 {
28
     return LibNfc::getVersion();
39
     return LibNfc::getVersion();
29
 }
40
 }
61
 {
72
 {
62
     return _libNfc;
73
     return _libNfc;
63
 }
74
 }
75
+
76
+std::string LibNfcBusiness::getMifareToolsVersion()
77
+{
78
+    return QUOTE(GIT_REF_NAME)  "-"  QUOTE(GIT_SHA1);
79
+}

+ 3
- 1
src/Business/LibNfcBusiness.h Bestand weergeven

26
 
26
 
27
     std::shared_ptr<LibNfc> getLibNfc() const;
27
     std::shared_ptr<LibNfc> getLibNfc() const;
28
 
28
 
29
-    static std::string getVersion();
29
+    static std::string getLibNfcVersion();
30
+
31
+    static std::string getMifareToolsVersion();
30
 
32
 
31
 protected:
33
 protected:
32
     std::shared_ptr<LibNfc> _libNfc;
34
     std::shared_ptr<LibNfc> _libNfc;

Laden…
Annuleren
Opslaan