Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
Framework
IO
Root
RootDB
SQLErrMsg.h
Go to the documentation of this file.
1
#ifndef art_Framework_IO_Root_RootDB_SQLErrMsg_h
2
#define art_Framework_IO_Root_RootDB_SQLErrMsg_h
3
4
// Little class to handle the management of an SQLite3 error message.
5
6
// Pass an instance of this class to an SQLite3 function expecting a
7
// char** into which to place an error message.
8
9
#include <string>
10
11
namespace
art
{
12
class
SQLErrMsg;
13
}
14
15
class
art::SQLErrMsg
{
16
public
:
17
SQLErrMsg
() :
errMsg_
(nullptr) {}
18
~SQLErrMsg
();
19
20
// Return the stored message.
21
std::string
22
msg
()
const
23
{
24
return
errMsg_
;
25
}
26
27
// Throw a suitable message if an error occurred.
28
void
throwIfError
();
29
30
// Reset and release memory. This will be done automatically in the
31
// destructor anyway.
32
void
reset
();
33
34
// Enable an object of this class to be passed to functions expecting
35
// char **.
36
operator
char
**()
37
{
38
reset
();
39
return
&
errMsg_
;
40
}
41
42
private
:
43
char
*
errMsg_
;
44
};
45
46
#endif
/* art_Framework_IO_Root_RootDB_SQLErrMsg_h */
47
48
// Local Variables:
49
// mode: c++
50
// End:
string
std::string string
Definition:
nybbler.cc:12
art::SQLErrMsg::~SQLErrMsg
~SQLErrMsg()
Definition:
SQLErrMsg.cc:27
art::SQLErrMsg::reset
void reset()
Definition:
SQLErrMsg.cc:21
art::SQLErrMsg::SQLErrMsg
SQLErrMsg()
Definition:
SQLErrMsg.h:17
art::SQLErrMsg::errMsg_
char * errMsg_
Definition:
SQLErrMsg.h:43
art::SQLErrMsg::msg
std::string msg() const
Definition:
SQLErrMsg.h:22
art
Definition:
BasicOptionsHandler.h:11
art::SQLErrMsg
Definition:
SQLErrMsg.h:15
art::SQLErrMsg::throwIfError
void throwIfError()
Definition:
SQLErrMsg.cc:10
Generated by
1.8.11