comparison Core/SQLite/Statement.cpp @ 50:a15e90e5d6fc

rename in code
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Sep 2012 15:50:12 +0200
parents db4d996ea264
children c996319e90bc
comparison
equal deleted inserted replaced
49:e1a3ae0dadf3 50:a15e90e5d6fc
1 /** 1 /**
2 * Palantir - A Lightweight, RESTful DICOM Store 2 * Palanthir - 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 Palantir 46 namespace Palanthir
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 PalantirException("SQLite error code " + boost::lexical_cast<std::string>(err)); 55 throw PalanthirException("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 PalantirException("Bind value out of range"); 66 throw PalanthirException("Bind value out of range");
67 } 67 }
68 else if (err != SQLITE_OK) 68 else if (err != SQLITE_OK)
69 { 69 {
70 throw PalantirException("SQLite error code " + boost::lexical_cast<std::string>(err)); 70 throw PalanthirException("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,