1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_connectivity.hxx"
26 
27 #include "propertyids.hxx"
28 
29 namespace dbtools
30 {
getPROPERTY_QUERYTIMEOUT()31 	const sal_Char* getPROPERTY_QUERYTIMEOUT()			{ return	"QueryTimeOut"; }
getPROPERTY_MAXFIELDSIZE()32 		const sal_Char* getPROPERTY_MAXFIELDSIZE()			{ return	"MaxFieldSize"; }
getPROPERTY_MAXROWS()33 		const sal_Char* getPROPERTY_MAXROWS()				{ return	"MaxRows"; }
getPROPERTY_CURSORNAME()34 		const sal_Char* getPROPERTY_CURSORNAME()			{ return	"CursorName"; }
getPROPERTY_RESULTSETCONCURRENCY()35 		const sal_Char* getPROPERTY_RESULTSETCONCURRENCY()	{ return	"ResultSetConcurrency"; }
getPROPERTY_RESULTSETTYPE()36 		const sal_Char* getPROPERTY_RESULTSETTYPE()			{ return	"ResultSetType"; }
getPROPERTY_FETCHDIRECTION()37 		const sal_Char* getPROPERTY_FETCHDIRECTION()		{ return	"FetchDirection"; }
getPROPERTY_FETCHSIZE()38 		const sal_Char* getPROPERTY_FETCHSIZE()				{ return	"FetchSize"; }
getPROPERTY_ESCAPEPROCESSING()39 		const sal_Char* getPROPERTY_ESCAPEPROCESSING()		{ return	"EscapeProcessing"; }
getPROPERTY_USEBOOKMARKS()40 		const sal_Char* getPROPERTY_USEBOOKMARKS()			{ return	"UseBookmarks"; }
41 
getPROPERTY_NAME()42 		const sal_Char* getPROPERTY_NAME()					{ return	"Name"; }
getPROPERTY_TYPE()43 		const sal_Char* getPROPERTY_TYPE()					{ return	"Type"; }
getPROPERTY_TYPENAME()44 		const sal_Char* getPROPERTY_TYPENAME()				{ return 	"TypeName"; }
getPROPERTY_PRECISION()45 		const sal_Char* getPROPERTY_PRECISION()				{ return 	"Precision"; }
getPROPERTY_SCALE()46 		const sal_Char* getPROPERTY_SCALE()					{ return 	"Scale"; }
getPROPERTY_ISNULLABLE()47 		const sal_Char* getPROPERTY_ISNULLABLE()			{ return 	"IsNullable"; }
getPROPERTY_ISAUTOINCREMENT()48 		const sal_Char* getPROPERTY_ISAUTOINCREMENT()		{ return 	"IsAutoIncrement"; }
getPROPERTY_ISROWVERSION()49 		const sal_Char* getPROPERTY_ISROWVERSION()			{ return 	"IsRowVersion"; }
getPROPERTY_DESCRIPTION()50 		const sal_Char* getPROPERTY_DESCRIPTION()			{ return 	"Description"; }
getPROPERTY_DEFAULTVALUE()51 		const sal_Char* getPROPERTY_DEFAULTVALUE()			{ return 	"DefaultValue"; }
52 
getPROPERTY_REFERENCEDTABLE()53 		const sal_Char* getPROPERTY_REFERENCEDTABLE()		{ return 	"ReferencedTable"; }
getPROPERTY_UPDATERULE()54 		const sal_Char* getPROPERTY_UPDATERULE()			{ return 	"UpdateRule"; }
getPROPERTY_DELETERULE()55 		const sal_Char* getPROPERTY_DELETERULE()			{ return 	"DeleteRule"; }
getPROPERTY_CATALOG()56 		const sal_Char* getPROPERTY_CATALOG()				{ return 	"Catalog"; }
getPROPERTY_ISUNIQUE()57 		const sal_Char* getPROPERTY_ISUNIQUE()				{ return 	"IsUnique"; }
getPROPERTY_ISPRIMARYKEYINDEX()58 		const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX()		{ return 	"IsPrimaryKeyIndex"; }
getPROPERTY_ISCLUSTERED()59 		const sal_Char* getPROPERTY_ISCLUSTERED()			{ return 	"IsClustered"; }
getPROPERTY_ISASCENDING()60 		const sal_Char* getPROPERTY_ISASCENDING()			{ return 	"IsAscending"; }
getPROPERTY_SCHEMANAME()61 		const sal_Char* getPROPERTY_SCHEMANAME()			{ return 	"SchemaName"; }
getPROPERTY_CATALOGNAME()62 		const sal_Char* getPROPERTY_CATALOGNAME()			{ return 	"CatalogName"; }
getPROPERTY_COMMAND()63 		const sal_Char* getPROPERTY_COMMAND()				{ return 	"Command"; }
getPROPERTY_CHECKOPTION()64 		const sal_Char* getPROPERTY_CHECKOPTION()			{ return 	"CheckOption"; }
getPROPERTY_PASSWORD()65 		const sal_Char* getPROPERTY_PASSWORD()				{ return 	"Password"; }
getPROPERTY_RELATEDCOLUMN()66 		const sal_Char* getPROPERTY_RELATEDCOLUMN()			{ return 	"RelatedColumn"; }
67 
getPROPERTY_FUNCTION()68 		const sal_Char* getPROPERTY_FUNCTION()				{ return 	"Function"; }
getPROPERTY_AGGREGATEFUNCTION()69 		const sal_Char* getPROPERTY_AGGREGATEFUNCTION()		{ return 	"AggregateFunction"; }
getPROPERTY_TABLENAME()70 		const sal_Char* getPROPERTY_TABLENAME()				{ return 	"TableName"; }
getPROPERTY_REALNAME()71 		const sal_Char* getPROPERTY_REALNAME()				{ return 	"RealName"; }
getPROPERTY_DBASEPRECISIONCHANGED()72 		const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return	"DbasePrecisionChanged"; }
getPROPERTY_ISCURRENCY()73 		const sal_Char* getPROPERTY_ISCURRENCY()			{ return 	"IsCurrency"; }
getPROPERTY_ISBOOKMARKABLE()74 		const sal_Char* getPROPERTY_ISBOOKMARKABLE()		{ return 	"IsBookmarkable"; }
75 
getPROPERTY_FORMATKEY()76 		const sal_Char* getPROPERTY_FORMATKEY()				{ return 	"FormatKey"; }
getPROPERTY_LOCALE()77 		const sal_Char* getPROPERTY_LOCALE()				{ return 	"Locale"; }
78 
getPROPERTY_AUTOINCREMENTCREATION()79 		const sal_Char* getPROPERTY_AUTOINCREMENTCREATION()	{ return 	"AutoIncrementCreation"; }
getPROPERTY_PRIVILEGES()80 		const sal_Char* getPROPERTY_PRIVILEGES()			{ return 	"Privileges"; }
getPROPERTY_ID_HAVINGCLAUSE()81 		const sal_Char* getPROPERTY_ID_HAVINGCLAUSE()		{ return 	"HavingClause"; }
getPROPERTY_ID_ISSIGNED()82 		const sal_Char* getPROPERTY_ID_ISSIGNED()			{ return 	"IsSigned"; }
getPROPERTY_ID_ISSEARCHABLE()83         const sal_Char* getPROPERTY_ID_ISSEARCHABLE()		{ return 	"IsSearchable"; }
84 
getPROPERTY_ID_APPLYFILTER()85         const sal_Char* getPROPERTY_ID_APPLYFILTER()		{ return 	"ApplyFilter"; }
getPROPERTY_ID_FILTER()86         const sal_Char* getPROPERTY_ID_FILTER()		        { return 	"Filter"; }
getPROPERTY_ID_MASTERFIELDS()87         const sal_Char* getPROPERTY_ID_MASTERFIELDS()	    { return 	"MasterFields"; }
getPROPERTY_ID_DETAILFIELDS()88         const sal_Char* getPROPERTY_ID_DETAILFIELDS()		{ return 	"DetailFields"; }
getPROPERTY_ID_FIELDTYPE()89         const sal_Char* getPROPERTY_ID_FIELDTYPE()			{ return 	"FieldType"; }
getPROPERTY_ID_VALUE()90         const sal_Char* getPROPERTY_ID_VALUE()			   	{ return 	"Value"; }
getPROPERTY_ID_ACTIVE_CONNECTION()91         const sal_Char* getPROPERTY_ID_ACTIVE_CONNECTION()	{ return 	"ActiveConnection"; }
getPROPERTY_ID_LABEL()92         const sal_Char* getPROPERTY_ID_LABEL()		        { return 	"Label"; }
93 
94 	//============================================================
95 	//= error messages
96 	//============================================================
getSQLSTATE_SEQUENCE()97 		const sal_Char* getSQLSTATE_SEQUENCE()				{ return 	"HY010"; }
getSTR_DELIMITER()98 		const sal_Char* getSTR_DELIMITER()					{ return 	"/"; }
99 
100 
101 
~OPropertyMap()102 		OPropertyMap::~OPropertyMap()
103 		{
104 			::std::map<sal_Int32 , rtl_uString*>::iterator aIter = m_aPropertyMap.begin();
105 			for(;aIter != m_aPropertyMap.end();++aIter)
106 				if(aIter->second)
107 					rtl_uString_release(aIter->second);
108 		}
109 		// ------------------------------------------------------------------------------
getNameByIndex(sal_Int32 _nIndex) const110 		::rtl::OUString OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const
111 		{
112 			::rtl::OUString sRet;
113 			::std::map<sal_Int32 , rtl_uString*>::const_iterator aIter = m_aPropertyMap.find(_nIndex);
114 			if(aIter == m_aPropertyMap.end())
115 				sRet = const_cast<OPropertyMap*>(this)->fillValue(_nIndex);
116 			else
117 				sRet = aIter->second;
118 			return sRet;
119 		}
120 		// ------------------------------------------------------------------------------
fillValue(sal_Int32 _nIndex)121 		::rtl::OUString OPropertyMap::fillValue(sal_Int32 _nIndex)
122 		{
123 			rtl_uString* pStr = NULL;
124 			switch(_nIndex)
125 			{
126 				case PROPERTY_ID_QUERYTIMEOUT:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT()			); break; }
127 				case PROPERTY_ID_MAXFIELDSIZE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE()			); break; }
128 				case PROPERTY_ID_MAXROWS:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS()				); break;		}
129 				case PROPERTY_ID_CURSORNAME:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME()			); break;	}
130 				case PROPERTY_ID_RESULTSETCONCURRENCY:		{ rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY()	); break; }
131 				case PROPERTY_ID_RESULTSETTYPE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE()			); break; }
132 				case PROPERTY_ID_FETCHDIRECTION:			{ rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION()		); break; }
133 				case PROPERTY_ID_FETCHSIZE:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE()				); break;	}
134 				case PROPERTY_ID_ESCAPEPROCESSING:			{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING()		); break; }
135 				case PROPERTY_ID_USEBOOKMARKS:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS()			); break; }
136 				// Column
137 				case PROPERTY_ID_NAME:						{ rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME()				); break; }
138 				case PROPERTY_ID_TYPE:						{ rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE()				); break; }
139 				case PROPERTY_ID_TYPENAME:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME()			); break; }
140 				case PROPERTY_ID_PRECISION:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION()			); break; }
141 				case PROPERTY_ID_SCALE:						{ rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE()				); break; }
142 				case PROPERTY_ID_ISNULLABLE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE()		); break; }
143 				case PROPERTY_ID_ISAUTOINCREMENT:			{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT()	); break; }
144 				case PROPERTY_ID_ISROWVERSION:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION()		); break; }
145 				case PROPERTY_ID_DESCRIPTION:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION()		); break; }
146 				case PROPERTY_ID_DEFAULTVALUE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE()		); break; }
147 
148 				case PROPERTY_ID_REFERENCEDTABLE:			{ rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE()	); break; }
149 				case PROPERTY_ID_UPDATERULE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE()		); break; }
150 				case PROPERTY_ID_DELETERULE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE()		); break; }
151 				case PROPERTY_ID_CATALOG:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG()			); break; }
152 				case PROPERTY_ID_ISUNIQUE:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE()			); break; }
153 				case PROPERTY_ID_ISPRIMARYKEYINDEX:			{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX()	); break; }
154 				case PROPERTY_ID_ISCLUSTERED:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED()			); break; }
155 				case PROPERTY_ID_ISASCENDING:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING()			); break; }
156 				case PROPERTY_ID_SCHEMANAME:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME()			); break; }
157 				case PROPERTY_ID_CATALOGNAME:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME()			); break; }
158 
159 				case PROPERTY_ID_COMMAND:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND()				); break; }
160 				case PROPERTY_ID_CHECKOPTION:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION()			); break; }
161 				case PROPERTY_ID_PASSWORD:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD()				); break; }
162 				case PROPERTY_ID_RELATEDCOLUMN:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN()		); break;  }
163 
164 				case PROPERTY_ID_FUNCTION:           		{ rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION()				); break; }
165 				case PROPERTY_ID_AGGREGATEFUNCTION:          { rtl_uString_newFromAscii(&pStr,getPROPERTY_AGGREGATEFUNCTION()	); break; }
166 				case PROPERTY_ID_TABLENAME:          		{ rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME()			); break; }
167 				case PROPERTY_ID_REALNAME:           		{ rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME()				); break; }
168 				case PROPERTY_ID_DBASEPRECISIONCHANGED:		{ rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED()); break; }
169 				case PROPERTY_ID_ISCURRENCY:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY()			); break; }
170 				case PROPERTY_ID_ISBOOKMARKABLE:			{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE()		); break; }
171 				case PROPERTY_ID_HY010:						{ rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE()				); break; }
172 				case PROPERTY_ID_DELIMITER:					{ rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER()					); break; }
173 				case PROPERTY_ID_FORMATKEY:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY()			); break; }
174 				case PROPERTY_ID_LOCALE:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE()				); break; }
175 				case PROPERTY_ID_AUTOINCREMENTCREATION:		{ rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION()); break; }
176 				case PROPERTY_ID_PRIVILEGES:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES()			); break; }
177 				case PROPERTY_ID_HAVINGCLAUSE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_HAVINGCLAUSE()		); break; }
178 				case PROPERTY_ID_ISSIGNED:					{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSIGNED()			); break; }
179                 case PROPERTY_ID_ISSEARCHABLE:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSEARCHABLE()		); break; }
180                 case PROPERTY_ID_LABEL:				        { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_LABEL()		        ); break; }
181                 case PROPERTY_ID_APPLYFILTER:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_APPLYFILTER()		); break; }
182                 case PROPERTY_ID_FILTER:				    { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FILTER()			); break; }
183                 case PROPERTY_ID_MASTERFIELDS:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_MASTERFIELDS()		); break; }
184                 case PROPERTY_ID_DETAILFIELDS:				{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_DETAILFIELDS()		); break; }
185                 case PROPERTY_ID_FIELDTYPE:				    { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FIELDTYPE()			); break; }
186                 case PROPERTY_ID_VALUE:				        { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_VALUE()			    ); break; }
187                 case PROPERTY_ID_ACTIVE_CONNECTION:			{ rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ACTIVE_CONNECTION() ); break; }
188 			}
189 			m_aPropertyMap[_nIndex] = pStr;
190 			return pStr;
191 		}
192 }
193 
194 
195