00001 // LICENSE: (Please see the file COPYING for details) 00002 // 00003 // NUS - Nemesis Utilities System: A C++ application development framework 00004 // Copyright (C) 2006, 2008 Otavio Rodolfo Piske 00005 // 00006 // This file is part of NUS 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Lesser General Public 00010 // License as published by the Free Software Foundation version 2.1 00011 // of the License. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Lesser General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU Lesser General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 // 00022 #include "nsqlquery.h" 00023 00024 NSqlQuery::NSqlQuery(void) 00025 : NObject(), 00026 m_query() 00027 { 00028 00029 } 00030 00031 00032 NSqlQuery::NSqlQuery(const NString &query) 00033 : NObject(), 00034 m_query(query) 00035 { 00036 00037 } 00038 00039 00040 NSqlQuery::NSqlQuery(const NSqlQuery &other) 00041 : NObject(), 00042 m_query(other.m_query) 00043 { 00044 00045 } 00046 00047 00048 NSqlQuery::~NSqlQuery(void) { 00049 00050 } 00051 00052 00053 bool NSqlQuery::bindValue(const NString &name, const NVtype &value) { 00054 if (m_query.find(name) != NString::NOT_FOUND) { 00055 m_query.replace_first(name, value.toString()); 00056 00057 return true; 00058 } 00059 return false; 00060 } 00061 00062 00063 bool NSqlQuery::addBindValue(const NVtype &value) { 00064 if (m_query.find("?") != NString::NOT_FOUND) { 00065 m_query.replace_first("?", value.toString()); 00066 00067 return true; 00068 } 00069 00070 return false; 00071 } 00072 00073 void NSqlQuery::set(const NString &query) { 00074 m_query = query; 00075 } 00076 00077 00078 NString NSqlQuery::get(void) const { 00079 return m_query; 00080 }