filesystem improvements
library directory tree improved in order to better comply with unix fs hierarchy standard
This commit is contained in:
parent
9b093be81e
commit
91492cad20
34
lib/CNS.h
34
lib/CNS.h
|
@ -1,5 +1,10 @@
|
|||
#ifndef CONVERT_H
|
||||
#define CONVERT_H
|
||||
#ifndef CNS_H
|
||||
#define CNS_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <winscard.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
@ -11,12 +16,31 @@
|
|||
#include <QString>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "Ex.h"
|
||||
// QT -- What to export
|
||||
//#define CNS Q_DECL_EXPORT CNS
|
||||
|
||||
#include "read_dati_personali_c.h"
|
||||
// PCSCLITE
|
||||
// --------------------------------------------------------------------
|
||||
int read_dati_personali_c(char** output_buffer, int* len);
|
||||
|
||||
#define CNS Q_DECL_EXPORT CNS
|
||||
// EXCEPTIONS
|
||||
// --------------------------------------------------------------------
|
||||
/* `explicit` specifier forces constructors to not being implicitly called */
|
||||
class Ex {
|
||||
private:
|
||||
std::string msg;
|
||||
public:
|
||||
explicit Ex();
|
||||
explicit Ex(const char* msg);
|
||||
explicit Ex(const std::string& msg);
|
||||
friend std::ostream& operator<<(std::ostream&, const Ex&);
|
||||
};
|
||||
|
||||
/* Parent::Parent makes classes inherit their constructors from parents (C++11) */
|
||||
class ExPCSC : public Ex { using Ex::Ex; };
|
||||
|
||||
// CNS
|
||||
// --------------------------------------------------------------------
|
||||
enum Sex {
|
||||
F,
|
||||
M
|
||||
|
|
10
lib/Ex.cpp
10
lib/Ex.cpp
|
@ -1,4 +1,4 @@
|
|||
#include "Ex.h"
|
||||
#include "CNS.h"
|
||||
|
||||
Ex::Ex() {
|
||||
this->msg = std::string("generic exception");
|
||||
|
@ -12,13 +12,7 @@ Ex::Ex(const std::string& msg) {
|
|||
this->msg = msg;
|
||||
}
|
||||
|
||||
/*
|
||||
Ex::Ex(const char* msg, int n) {
|
||||
this->msg = std::string(msg) + ": " + strerror(n);
|
||||
}
|
||||
*/
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Ex& e) {
|
||||
os << e.msg;
|
||||
return os;
|
||||
}
|
||||
}
|
||||
|
|
21
lib/Ex.h
21
lib/Ex.h
|
@ -1,21 +0,0 @@
|
|||
#ifndef EXCEPTION_H
|
||||
#define EXCEPTION_H
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
/* `explicit` specifier forces constructors to not being implicitly called */
|
||||
class Ex {
|
||||
private:
|
||||
std::string msg;
|
||||
public:
|
||||
explicit Ex();
|
||||
explicit Ex(const char* msg);
|
||||
explicit Ex(const std::string& msg);
|
||||
friend std::ostream& operator<<(std::ostream&, const Ex&);
|
||||
};
|
||||
|
||||
/* Parent::Parent makes classes inherit their constructors from parents (C++11) */
|
||||
class ExPCSC : public Ex { using Ex::Ex; };
|
||||
|
||||
#endif
|
|
@ -28,10 +28,10 @@ SOURCES += \
|
|||
read_dati_personali_c.cpp
|
||||
|
||||
HEADERS += \
|
||||
CNS.h \
|
||||
Ex.h \
|
||||
read_dati_personali_c.h
|
||||
|
||||
INSTALLS += target
|
||||
CNS.h
|
||||
|
||||
target.path = /usr/lib
|
||||
headers.path = /usr/include
|
||||
headers.files += $$HEADERS
|
||||
|
||||
INSTALLS += target headers
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "read_dati_personali_c.h"
|
||||
#include "CNS.h"
|
||||
|
||||
/*
|
||||
``
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
#ifndef READ_DATI_PERSONALI_H
|
||||
#define READ_DATI_PERSONALI_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <winscard.h>
|
||||
|
||||
#include "Ex.h"
|
||||
|
||||
int read_dati_personali_c(char** output_buffer, int* len);
|
||||
|
||||
#endif
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <QTextStream>
|
||||
|
||||
#include "../lib/CNS.h"
|
||||
#include <CNS.h>
|
||||
|
||||
int main(void) {
|
||||
CNS cns;
|
||||
|
|
Loading…
Reference in New Issue