1
/***************************************************************************
2
qgspgutil.cpp - PostgreSQL Utility Functions
3
--------------------------------------
5
Copyright : (C) 2004 by Gary E.Sherman
6
Email : sherman at mrcc.com
7
***************************************************************************
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
***************************************************************************/
15
/* $Id: qgspgutil.cpp 4619 2006-01-08 23:18:32Z timlinux $ */
16
#include "qgspgutil.h"
18
QgsPgUtil *QgsPgUtil::mInstance = 0;
19
QgsPgUtil * QgsPgUtil::instance()
23
mInstance = new QgsPgUtil();
27
QgsPgUtil::QgsPgUtil()
29
// load the reserved word map
32
QgsPgUtil::~QgsPgUtil()
35
bool QgsPgUtil::isReserved(QString word)
37
// uppercase the word before testing it since all our reserved words are
38
// stored in uppercase
40
QStringList::iterator it = mReservedWords.find(word.upper());
41
return (it != mReservedWords.end());
43
void QgsPgUtil::setConnection(PGconn *con)
47
PGconn *QgsPgUtil::connection()
51
const QStringList & QgsPgUtil::reservedWords()
53
return mReservedWords;
55
void QgsPgUtil::initReservedWords()
57
// create the reserved word list by loading
58
// the words into a QStringList. We code them here
59
// for now rather than deal with the complexities
60
// of finding and loading from a text file
61
// in the install path
62
mReservedWords << "ALL"
84
<< "CURRENT_TIMESTAMP"