QNLP  v1.0
db_helper.hpp File Reference

Database access and manipulation functions. More...

#include <iostream>
#include <sqlite3.h>
#include <string>
Include dependency graph for db_helper.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  QNLP::DBHelper
 

Namespaces

 QNLP
 

Macros

#define SQL_RETURN_CHECK(x, y)
 

Functions

void sql_return_check (const int ret_code, const int expected_code, const char *fileName, const std::size_t lineNum)
 

Detailed Description

Database access and manipulation functions.

Author
Lee J. O'Riordan (lee.o.nosp@m.rior.nosp@m.dan@i.nosp@m.chec.nosp@m..ie)
Version
0.1
Date
2019-03-11

Definition in file db_helper.hpp.

Macro Definition Documentation

◆ SQL_RETURN_CHECK

#define SQL_RETURN_CHECK (   x,
 
)

Definition at line 19 of file db_helper.hpp.

Function Documentation

◆ sql_return_check()

void sql_return_check ( const int  ret_code,
const int  expected_code,
const char *  fileName,
const std::size_t  lineNum 
)
inline

Definition at line 20 of file db_helper.hpp.

23  {
24 #ifdef SQL_ERR_CHECK
25  if ( ret_code != expected_code ) {
26  std::cerr << "SQL error: FILE: " << fileName << "\t LINE: " << lineNum << "\t RETURN_CODE: " << ret_code << std::endl;
27  std::exit(ret_code);
28  }
29 #endif
30 }