Преглед на файлове

moved version to libnfcbusiness

develop
Robin Thoni преди 7 години
родител
ревизия
5798589003
променени са 3 файла, в които са добавени 22 реда и са изтрити 15 реда
  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 Целия файл

@@ -19,17 +19,6 @@ MainClass::MainClass(int argc, char *argv[])
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 22
 int MainClass::main()
34 23
 {
35 24
     CommandLineParser parser(_argc, _argv);
@@ -233,8 +222,8 @@ void MainClass::printPercentDump(int done, int total)
233 222
 
234 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 229
 std::shared_ptr<NfcDeviceBusiness> MainClass::getDevice(const std::string &deviceName, std::vector<std::shared_ptr<NfcDeviceBusiness>> devices)

+ 17
- 1
src/Business/LibNfcBusiness.cpp Целия файл

@@ -5,6 +5,17 @@
5 5
 #include <algorithm>
6 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 19
 LibNfcBusiness::LibNfcBusiness()
9 20
 {
10 21
     _libNfc = std::make_shared<LibNfc>();
@@ -23,7 +34,7 @@ ResultBool LibNfcBusiness::init()
23 34
     return _libNfc->init();
24 35
 }
25 36
 
26
-std::string LibNfcBusiness::getVersion()
37
+std::string LibNfcBusiness::getLibNfcVersion()
27 38
 {
28 39
     return LibNfc::getVersion();
29 40
 }
@@ -61,3 +72,8 @@ std::shared_ptr<LibNfc> LibNfcBusiness::getLibNfc() const
61 72
 {
62 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 Целия файл

@@ -26,7 +26,9 @@ public:
26 26
 
27 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 33
 protected:
32 34
     std::shared_ptr<LibNfc> _libNfc;

Loading…
Отказ
Запис