Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : #include "propertyids.hxx"
22 :
23 : namespace dbtools
24 : {
25 16 : const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; }
26 16 : const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; }
27 16 : const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; }
28 16 : const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; }
29 18 : const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; }
30 18 : const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; }
31 18 : const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; }
32 18 : const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; }
33 16 : const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; }
34 4 : const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; }
35 :
36 16 : const sal_Char* getPROPERTY_NAME() { return "Name"; }
37 16 : const sal_Char* getPROPERTY_TYPE() { return "Type"; }
38 16 : const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; }
39 16 : const sal_Char* getPROPERTY_PRECISION() { return "Precision"; }
40 16 : const sal_Char* getPROPERTY_SCALE() { return "Scale"; }
41 16 : const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; }
42 16 : const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; }
43 16 : const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; }
44 16 : const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; }
45 16 : const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; }
46 :
47 4 : const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; }
48 4 : const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; }
49 4 : const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; }
50 0 : const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; }
51 0 : const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; }
52 0 : const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; }
53 0 : const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; }
54 6 : const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; }
55 16 : const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; }
56 16 : const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; }
57 0 : const sal_Char* getPROPERTY_COMMAND() { return "Command"; }
58 0 : const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; }
59 2 : const sal_Char* getPROPERTY_PASSWORD() { return "Password"; }
60 0 : const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; }
61 :
62 16 : const sal_Char* getPROPERTY_FUNCTION() { return "Function"; }
63 16 : const sal_Char* getPROPERTY_AGGREGATEFUNCTION() { return "AggregateFunction"; }
64 16 : const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; }
65 16 : const sal_Char* getPROPERTY_REALNAME() { return "RealName"; }
66 16 : const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; }
67 16 : const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; }
68 12 : const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; }
69 :
70 2 : const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; }
71 0 : const sal_Char* getPROPERTY_LOCALE() { return "Locale"; }
72 :
73 0 : const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; }
74 4 : const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; }
75 0 : const sal_Char* getPROPERTY_ID_HAVINGCLAUSE() { return "HavingClause"; }
76 0 : const sal_Char* getPROPERTY_ID_ISSIGNED() { return "IsSigned"; }
77 16 : const sal_Char* getPROPERTY_ID_ISSEARCHABLE() { return "IsSearchable"; }
78 :
79 32 : const sal_Char* getPROPERTY_ID_APPLYFILTER() { return "ApplyFilter"; }
80 0 : const sal_Char* getPROPERTY_ID_FILTER() { return "Filter"; }
81 4 : const sal_Char* getPROPERTY_ID_MASTERFIELDS() { return "MasterFields"; }
82 4 : const sal_Char* getPROPERTY_ID_DETAILFIELDS() { return "DetailFields"; }
83 0 : const sal_Char* getPROPERTY_ID_FIELDTYPE() { return "FieldType"; }
84 0 : const sal_Char* getPROPERTY_ID_VALUE() { return "Value"; }
85 4 : const sal_Char* getPROPERTY_ID_ACTIVE_CONNECTION() { return "ActiveConnection"; }
86 16 : const sal_Char* getPROPERTY_ID_LABEL() { return "Label"; }
87 :
88 :
89 : //= error messages
90 :
91 0 : const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; }
92 0 : const sal_Char* getSTR_DELIMITER() { return "/"; }
93 :
94 :
95 :
96 84 : OPropertyMap::~OPropertyMap()
97 : {
98 42 : ::std::map<sal_Int32 , rtl_uString*>::iterator aIter = m_aPropertyMap.begin();
99 600 : for(;aIter != m_aPropertyMap.end();++aIter)
100 558 : if(aIter->second)
101 558 : rtl_uString_release(aIter->second);
102 42 : }
103 :
104 154140 : OUString OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const
105 : {
106 154140 : OUString sRet;
107 154140 : ::std::map<sal_Int32 , rtl_uString*>::const_iterator aIter = m_aPropertyMap.find(_nIndex);
108 154140 : if(aIter == m_aPropertyMap.end())
109 558 : sRet = const_cast<OPropertyMap*>(this)->fillValue(_nIndex);
110 : else
111 153582 : sRet = aIter->second;
112 154140 : return sRet;
113 : }
114 :
115 558 : OUString OPropertyMap::fillValue(sal_Int32 _nIndex)
116 : {
117 558 : rtl_uString* pStr = NULL;
118 558 : switch(_nIndex)
119 : {
120 16 : case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; }
121 16 : case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; }
122 16 : case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; }
123 16 : case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; }
124 18 : case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; }
125 18 : case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; }
126 18 : case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; }
127 18 : case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; }
128 16 : case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; }
129 4 : case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; }
130 : // Column
131 16 : case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; }
132 16 : case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; }
133 16 : case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; }
134 16 : case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; }
135 16 : case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; }
136 16 : case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; }
137 16 : case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; }
138 16 : case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; }
139 16 : case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; }
140 16 : case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; }
141 :
142 4 : case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; }
143 4 : case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; }
144 4 : case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; }
145 0 : case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; }
146 0 : case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; }
147 0 : case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; }
148 0 : case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; }
149 6 : case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; }
150 16 : case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; }
151 16 : case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; }
152 :
153 0 : case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; }
154 0 : case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; }
155 2 : case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; }
156 0 : case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; }
157 :
158 16 : case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; }
159 16 : case PROPERTY_ID_AGGREGATEFUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AGGREGATEFUNCTION() ); break; }
160 16 : case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; }
161 16 : case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; }
162 16 : case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED()); break; }
163 16 : case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; }
164 12 : case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; }
165 0 : case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; }
166 0 : case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; }
167 2 : case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; }
168 0 : case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; }
169 0 : case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION()); break; }
170 4 : case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; }
171 0 : case PROPERTY_ID_HAVINGCLAUSE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_HAVINGCLAUSE() ); break; }
172 0 : case PROPERTY_ID_ISSIGNED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSIGNED() ); break; }
173 16 : case PROPERTY_ID_ISSEARCHABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSEARCHABLE() ); break; }
174 16 : case PROPERTY_ID_LABEL: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_LABEL() ); break; }
175 32 : case PROPERTY_ID_APPLYFILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_APPLYFILTER() ); break; }
176 0 : case PROPERTY_ID_FILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FILTER() ); break; }
177 4 : case PROPERTY_ID_MASTERFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_MASTERFIELDS() ); break; }
178 4 : case PROPERTY_ID_DETAILFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_DETAILFIELDS() ); break; }
179 0 : case PROPERTY_ID_FIELDTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FIELDTYPE() ); break; }
180 0 : case PROPERTY_ID_VALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_VALUE() ); break; }
181 4 : case PROPERTY_ID_ACTIVE_CONNECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ACTIVE_CONNECTION() ); break; }
182 : }
183 558 : m_aPropertyMap[_nIndex] = pStr;
184 558 : return pStr ? OUString(pStr) : OUString();
185 : }
186 : }
187 :
188 :
189 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|