Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / connectivity / source / commontools / propertyids.cxx
blob5b3d6356f26ed86025b1b93b2463bc2edc9e9a09
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "propertyids.hxx"
23 namespace dbtools
25 const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; }
26 const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; }
27 const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; }
28 const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; }
29 const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; }
30 const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; }
31 const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; }
32 const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; }
33 const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; }
34 const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; }
36 const sal_Char* getPROPERTY_NAME() { return "Name"; }
37 const sal_Char* getPROPERTY_TYPE() { return "Type"; }
38 const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; }
39 const sal_Char* getPROPERTY_PRECISION() { return "Precision"; }
40 const sal_Char* getPROPERTY_SCALE() { return "Scale"; }
41 const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; }
42 const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; }
43 const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; }
44 const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; }
45 const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; }
47 const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; }
48 const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; }
49 const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; }
50 const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; }
51 const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; }
52 const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; }
53 const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; }
54 const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; }
55 const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; }
56 const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; }
57 const sal_Char* getPROPERTY_COMMAND() { return "Command"; }
58 const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; }
59 const sal_Char* getPROPERTY_PASSWORD() { return "Password"; }
60 const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; }
62 const sal_Char* getPROPERTY_FUNCTION() { return "Function"; }
63 const sal_Char* getPROPERTY_AGGREGATEFUNCTION() { return "AggregateFunction"; }
64 const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; }
65 const sal_Char* getPROPERTY_REALNAME() { return "RealName"; }
66 const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; }
67 const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; }
68 const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; }
70 const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; }
71 const sal_Char* getPROPERTY_LOCALE() { return "Locale"; }
73 const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; }
74 const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; }
75 const sal_Char* getPROPERTY_ID_HAVINGCLAUSE() { return "HavingClause"; }
76 const sal_Char* getPROPERTY_ID_ISSIGNED() { return "IsSigned"; }
77 const sal_Char* getPROPERTY_ID_ISSEARCHABLE() { return "IsSearchable"; }
79 const sal_Char* getPROPERTY_ID_APPLYFILTER() { return "ApplyFilter"; }
80 const sal_Char* getPROPERTY_ID_FILTER() { return "Filter"; }
81 const sal_Char* getPROPERTY_ID_MASTERFIELDS() { return "MasterFields"; }
82 const sal_Char* getPROPERTY_ID_DETAILFIELDS() { return "DetailFields"; }
83 const sal_Char* getPROPERTY_ID_FIELDTYPE() { return "FieldType"; }
84 const sal_Char* getPROPERTY_ID_VALUE() { return "Value"; }
85 const sal_Char* getPROPERTY_ID_ACTIVE_CONNECTION() { return "ActiveConnection"; }
86 const sal_Char* getPROPERTY_ID_LABEL() { return "Label"; }
89 //= error messages
91 const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; }
92 const sal_Char* getSTR_DELIMITER() { return "/"; }
96 OPropertyMap::~OPropertyMap()
98 ::std::map<sal_Int32 , rtl_uString*>::iterator aIter = m_aPropertyMap.begin();
99 for(;aIter != m_aPropertyMap.end();++aIter)
100 if(aIter->second)
101 rtl_uString_release(aIter->second);
104 OUString OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const
106 OUString sRet;
107 ::std::map<sal_Int32 , rtl_uString*>::const_iterator aIter = m_aPropertyMap.find(_nIndex);
108 if(aIter == m_aPropertyMap.end())
109 sRet = const_cast<OPropertyMap*>(this)->fillValue(_nIndex);
110 else
111 sRet = aIter->second;
112 return sRet;
115 OUString OPropertyMap::fillValue(sal_Int32 _nIndex)
117 rtl_uString* pStr = NULL;
118 switch(_nIndex)
120 case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; }
121 case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; }
122 case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; }
123 case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; }
124 case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; }
125 case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; }
126 case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; }
127 case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; }
128 case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; }
129 case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; }
130 // Column
131 case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; }
132 case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; }
133 case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; }
134 case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; }
135 case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; }
136 case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; }
137 case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; }
138 case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; }
139 case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; }
140 case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; }
142 case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; }
143 case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; }
144 case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; }
145 case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; }
146 case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; }
147 case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; }
148 case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; }
149 case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; }
150 case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; }
151 case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; }
153 case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; }
154 case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; }
155 case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; }
156 case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; }
158 case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; }
159 case PROPERTY_ID_AGGREGATEFUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AGGREGATEFUNCTION() ); break; }
160 case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; }
161 case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; }
162 case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED()); break; }
163 case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; }
164 case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; }
165 case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; }
166 case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; }
167 case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; }
168 case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; }
169 case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION()); break; }
170 case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; }
171 case PROPERTY_ID_HAVINGCLAUSE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_HAVINGCLAUSE() ); break; }
172 case PROPERTY_ID_ISSIGNED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSIGNED() ); break; }
173 case PROPERTY_ID_ISSEARCHABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSEARCHABLE() ); break; }
174 case PROPERTY_ID_LABEL: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_LABEL() ); break; }
175 case PROPERTY_ID_APPLYFILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_APPLYFILTER() ); break; }
176 case PROPERTY_ID_FILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FILTER() ); break; }
177 case PROPERTY_ID_MASTERFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_MASTERFIELDS() ); break; }
178 case PROPERTY_ID_DETAILFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_DETAILFIELDS() ); break; }
179 case PROPERTY_ID_FIELDTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FIELDTYPE() ); break; }
180 case PROPERTY_ID_VALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_VALUE() ); break; }
181 case PROPERTY_ID_ACTIVE_CONNECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ACTIVE_CONNECTION() ); break; }
183 m_aPropertyMap[_nIndex] = pStr;
184 return pStr ? OUString(pStr) : OUString();
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */