Browse Source

init

master
Robin Thoni 9 years ago
commit
0a4f668a10
8 changed files with 134 additions and 0 deletions
  1. 36
    0
      .gitignore
  2. 7
    0
      CMakeLists.txt
  3. 6
    0
      DBO/ScByteArray.cpp
  4. 29
    0
      DBO/ScByteArray.h
  5. 28
    0
      DBO/ScByteArray.hxx
  6. 5
    0
      DBO/ScCommand.cpp
  7. 19
    0
      DBO/ScCommand.h
  8. 4
    0
      DBO/ScCommand.hxx

+ 36
- 0
.gitignore View File

@@ -0,0 +1,36 @@
1
+# Compiled Object files
2
+*.slo
3
+*.lo
4
+*.o
5
+*.obj
6
+
7
+# Precompiled Headers
8
+*.gch
9
+*.pch
10
+
11
+# Compiled Dynamic libraries
12
+*.so
13
+*.dylib
14
+*.dll
15
+
16
+# Fortran module files
17
+*.mod
18
+
19
+# Compiled Static libraries
20
+*.lai
21
+*.la
22
+*.a
23
+*.lib
24
+
25
+# Executables
26
+*.exe
27
+*.out
28
+*.app
29
+
30
+/.idea
31
+
32
+CMakeCache.txt
33
+CMakeFiles
34
+Makefile
35
+cmake_install.cmake
36
+install_manifest.txt

+ 7
- 0
CMakeLists.txt View File

@@ -0,0 +1,7 @@
1
+cmake_minimum_required(VERSION 2.8)
2
+project(libpcsc_cpptools)
3
+
4
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -I/usr/include/PCSC")
5
+
6
+set(SOURCE_FILES DBO/ScCommand.cpp DBO/ScCommand.h DBO/ScByteArray.cpp DBO/ScByteArray.h)
7
+add_library(libpcsc_cpptools SHARED ${SOURCE_FILES} DBO/ScByteArray.hxx DBO/ScCommand.hxx)

+ 6
- 0
DBO/ScByteArray.cpp View File

@@ -0,0 +1,6 @@
1
+//
2
+// Created by robin on 6/27/15.
3
+//
4
+
5
+#include "ScByteArray.h"
6
+

+ 29
- 0
DBO/ScByteArray.h View File

@@ -0,0 +1,29 @@
1
+//
2
+// Created by robin on 6/27/15.
3
+//
4
+
5
+#ifndef LIBPCSC_CPPTOOLS_SCBYTEARRAY_H
6
+# define LIBPCSC_CPPTOOLS_SCBYTEARRAY_H
7
+
8
+# include <winscard.h>
9
+
10
+class ScByteArray {
11
+
12
+public:
13
+    inline ScByteArray(BYTE* const data, const DWORD size);
14
+
15
+    inline ScByteArray(const ScByteArray& data);
16
+
17
+    inline DWORD getSize() const;
18
+
19
+    inline BYTE* getData() const;
20
+
21
+private:
22
+    DWORD _size;
23
+
24
+    BYTE* _data;
25
+};
26
+
27
+# include "ScByteArray.hxx"
28
+
29
+#endif //LIBPCSC_CPPTOOLS_SCBYTEARRAY_H

+ 28
- 0
DBO/ScByteArray.hxx View File

@@ -0,0 +1,28 @@
1
+//
2
+// Created by robin on 6/27/15.
3
+//
4
+
5
+#include <stdlib.h>
6
+#include <string.h>
7
+
8
+ScByteArray::ScByteArray(BYTE * const data, const DWORD size)
9
+        : _data(data)
10
+        , _size(size)
11
+{
12
+}
13
+
14
+ScByteArray::ScByteArray(const ScByteArray &data)
15
+{
16
+    _size = data._size;
17
+    _data = (BYTE*)memcpy(malloc(_size), data._data, _size);
18
+}
19
+
20
+DWORD ScByteArray::getSize() const
21
+{
22
+    return _size;
23
+}
24
+
25
+BYTE* ScByteArray::getData() const
26
+{
27
+    return _data;
28
+}

+ 5
- 0
DBO/ScCommand.cpp View File

@@ -0,0 +1,5 @@
1
+//
2
+// Created by robin on 6/27/15.
3
+//
4
+
5
+#include "ScCommand.h"

+ 19
- 0
DBO/ScCommand.h View File

@@ -0,0 +1,19 @@
1
+//
2
+// Created by robin on 6/27/15.
3
+//
4
+
5
+#ifndef LIBPCSC_CPPTOOLS_SCCOMMAND_H
6
+# define LIBPCSC_CPPTOOLS_SCCOMMAND_H
7
+
8
+# include "ScByteArray.h"
9
+
10
+class ScCommand {
11
+
12
+public:
13
+    virtual ScByteArray getData() const = 0;
14
+
15
+};
16
+
17
+# include "ScCommand.hxx"
18
+
19
+#endif //LIBPCSC_CPPTOOLS_SCCOMMAND_H

+ 4
- 0
DBO/ScCommand.hxx View File

@@ -0,0 +1,4 @@
1
+//
2
+// Created by robin on 6/27/15.
3
+//
4
+

Loading…
Cancel
Save