Mercurial > hg > orthanc
comparison Core/SQLite/Statement.cpp @ 59:c996319e90bc orthanc-renaming
renaming in Core
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 16 Sep 2012 09:28:56 +0200 |
parents | a15e90e5d6fc |
children | 6212bf978584 |
comparison
equal
deleted
inserted
replaced
58:6da7fc87efaa | 59:c996319e90bc |
---|---|
1 /** | 1 /** |
2 * Palanthir - A Lightweight, RESTful DICOM Store | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege, | 3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege, |
4 * Belgium | 4 * Belgium |
5 * | 5 * |
6 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 6 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
7 * | 7 * |
41 | 41 |
42 #include <boost/lexical_cast.hpp> | 42 #include <boost/lexical_cast.hpp> |
43 #include <sqlite3.h> | 43 #include <sqlite3.h> |
44 #include <string.h> | 44 #include <string.h> |
45 | 45 |
46 namespace Palanthir | 46 namespace Orthanc |
47 { | 47 { |
48 namespace SQLite | 48 namespace SQLite |
49 { | 49 { |
50 int Statement::CheckError(int err) const | 50 int Statement::CheckError(int err) const |
51 { | 51 { |
52 bool succeeded = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); | 52 bool succeeded = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); |
53 if (!succeeded) | 53 if (!succeeded) |
54 { | 54 { |
55 throw PalanthirException("SQLite error code " + boost::lexical_cast<std::string>(err)); | 55 throw OrthancException("SQLite error code " + boost::lexical_cast<std::string>(err)); |
56 } | 56 } |
57 | 57 |
58 return err; | 58 return err; |
59 } | 59 } |
60 | 60 |
61 void Statement::CheckOk(int err) const | 61 void Statement::CheckOk(int err) const |
62 { | 62 { |
63 if (err == SQLITE_RANGE) | 63 if (err == SQLITE_RANGE) |
64 { | 64 { |
65 // Binding to a non-existent variable is evidence of a serious error. | 65 // Binding to a non-existent variable is evidence of a serious error. |
66 throw PalanthirException("Bind value out of range"); | 66 throw OrthancException("Bind value out of range"); |
67 } | 67 } |
68 else if (err != SQLITE_OK) | 68 else if (err != SQLITE_OK) |
69 { | 69 { |
70 throw PalanthirException("SQLite error code " + boost::lexical_cast<std::string>(err)); | 70 throw OrthancException("SQLite error code " + boost::lexical_cast<std::string>(err)); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 | 74 |
75 Statement::Statement(Connection& database, | 75 Statement::Statement(Connection& database, |