1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #include "definitioncontainer.hxx"
21 #include "dbastrings.hrc"
22 #include "apitools.hxx"
23 #include "core_resource.hxx"
24 #include "core_resource.hrc"
26 #include <tools/debug.hxx>
27 #include <tools/diagnose_ex.h>
28 #include <osl/diagnose.h>
29 #include <comphelper/sequence.hxx>
30 #include <comphelper/enumhelper.hxx>
31 #include <comphelper/extract.hxx>
32 #include <cppuhelper/exc_hlp.hxx>
33 #include <com/sun/star/lang/XComponent.hpp>
34 #include <com/sun/star/ucb/CommandInfo.hpp>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/sdb/ErrorCondition.hpp>
37 #include <comphelper/types.hxx>
38 #include <ucbhelper/contentidentifier.hxx>
39 #include <o3tl/compat_functional.hxx>
41 using namespace ::com::sun::star::uno
;
42 using namespace ::com::sun::star::lang
;
43 using namespace ::com::sun::star::util
;
44 using namespace ::com::sun::star::beans
;
45 using namespace ::com::sun::star::container
;
46 using namespace ::com::sun::star::sdbcx
;
47 using namespace ::com::sun::star::sdb
;
48 using namespace ::osl
;
49 using namespace ::comphelper
;
50 using namespace ::cppu
;
51 using namespace ::com::sun::star::ucb
;
56 // ODefinitionContainer_Impl
57 void ODefinitionContainer_Impl::erase( TContentPtr _pDefinition
)
59 NamedDefinitions::iterator aPos
= find( _pDefinition
);
61 m_aDefinitions
.erase( aPos
);
64 ODefinitionContainer_Impl::const_iterator
ODefinitionContainer_Impl::find( TContentPtr _pDefinition
) const
66 return ::std::find_if(
67 m_aDefinitions
.begin(),
70 ::std::bind2nd( ::std::equal_to
< TContentPtr
>(), _pDefinition
),
71 ::o3tl::select2nd
< NamedDefinitions::value_type
>()
76 ODefinitionContainer_Impl::iterator
ODefinitionContainer_Impl::find( TContentPtr _pDefinition
)
78 return ::std::find_if(
79 m_aDefinitions
.begin(),
82 ::std::bind2nd( ::std::equal_to
< TContentPtr
>(), _pDefinition
),
83 ::o3tl::select2nd
< NamedDefinitions::value_type
>()
88 // ODefinitionContainer
90 ODefinitionContainer::ODefinitionContainer( const Reference
< XComponentContext
>& _xORB
91 , const Reference
< XInterface
>& _xParentContainer
92 , const TContentPtr
& _pImpl
95 :OContentHelper(_xORB
,_xParentContainer
,_pImpl
)
96 ,m_aApproveListeners(m_aMutex
)
97 ,m_aContainerListeners(m_aMutex
)
98 ,m_bInPropertyChange(false)
99 ,m_bCheckSlash(_bCheckSlash
)
101 m_pImpl
->m_aProps
.bIsDocument
= false;
102 m_pImpl
->m_aProps
.bIsFolder
= true;
104 const ODefinitionContainer_Impl
& rDefinitions( getDefinitions() );
105 ODefinitionContainer_Impl::const_iterator aEnd
= rDefinitions
.end();
106 for ( ODefinitionContainer_Impl::const_iterator aDefinition
= rDefinitions
.begin();
110 m_aDocuments
.push_back(
111 m_aDocumentMap
.insert(
112 Documents::value_type( aDefinition
->first
, Documents::mapped_type() ) ).first
);
116 void SAL_CALL
ODefinitionContainer::disposing()
118 OContentHelper::disposing();
120 MutexGuard
aGuard(m_aMutex
);
122 // say goodbye to our listeners
123 EventObject
aEvt(*this);
124 m_aApproveListeners
.disposeAndClear(aEvt
);
125 m_aContainerListeners
.disposeAndClear(aEvt
);
127 // dispose our elements
128 Documents::iterator aIter
= m_aDocumentMap
.begin();
129 Documents::iterator aEnd
= m_aDocumentMap
.end();
131 for (; aIter
!= aEnd
; ++aIter
)
133 Reference
<XContent
> xProp
= aIter
->second
;
136 removeObjectListener(xProp
);
137 ::comphelper::disposeComponent(xProp
);
141 // remove our elements
142 m_aDocuments
.clear();
143 // !!! do this before clearing the map which the vector elements refer to !!!
144 m_aDocumentMap
.clear();
147 ODefinitionContainer::~ODefinitionContainer()
151 IMPLEMENT_FORWARD_XINTERFACE2( ODefinitionContainer
,OContentHelper
,ODefinitionContainer_Base
)
152 IMPLEMENT_GETTYPES2(ODefinitionContainer
,OContentHelper
,ODefinitionContainer_Base
);
154 css::uno::Sequence
<sal_Int8
> ODefinitionContainer::getImplementationId()
155 throw (css::uno::RuntimeException
, std::exception
)
157 return css::uno::Sequence
<sal_Int8
>();
161 OUString SAL_CALL
ODefinitionContainer::getImplementationName( ) throw(RuntimeException
, std::exception
)
163 return OUString("com.sun.star.sdb.ODefinitionContainer");
166 Sequence
< OUString
> SAL_CALL
ODefinitionContainer::getSupportedServiceNames( ) throw(RuntimeException
, std::exception
)
168 Sequence
< OUString
> aReturn(2);
169 aReturn
.getArray()[0] = "com.sun.star.sdb.DefinitionContainer";
170 aReturn
.getArray()[1] = "com.sun.star.ucb.Content";
175 void SAL_CALL
ODefinitionContainer::insertByName( const OUString
& _rName
, const Any
& aElement
) throw(IllegalArgumentException
, ElementExistException
, WrappedTargetException
, RuntimeException
, std::exception
)
177 ResettableMutexGuard
aGuard(m_aMutex
);
179 // approve the new object
180 Reference
< XContent
> xNewElement(aElement
,UNO_QUERY
);
181 approveNewObject( _rName
, xNewElement
); // will throw if necessary
183 notifyByName( aGuard
, _rName
, xNewElement
, NULL
, E_INSERTED
, ApproveListeners
);
184 implAppend( _rName
, xNewElement
);
185 notifyByName( aGuard
, _rName
, xNewElement
, NULL
, E_INSERTED
, ContainerListemers
);
188 void SAL_CALL
ODefinitionContainer::removeByName( const OUString
& _rName
) throw(NoSuchElementException
, WrappedTargetException
, RuntimeException
, std::exception
)
190 ResettableMutexGuard
aGuard(m_aMutex
);
192 // check the arguments
193 if (_rName
.isEmpty())
194 throw IllegalArgumentException();
196 if (!checkExistence(_rName
))
197 throw NoSuchElementException(_rName
,*this);
199 // the old element (for the notifications)
200 Reference
< XContent
> xOldElement
= implGetByName( _rName
, impl_haveAnyListeners_nothrow() );
203 notifyByName( aGuard
, _rName
, NULL
, xOldElement
, E_REMOVED
, ApproveListeners
);
204 implRemove( _rName
);
205 notifyByName( aGuard
, _rName
, NULL
, xOldElement
, E_REMOVED
, ContainerListemers
);
207 removeObjectListener( xOldElement
);
208 disposeComponent(xOldElement
);
212 void SAL_CALL
ODefinitionContainer::replaceByName( const OUString
& _rName
, const Any
& aElement
) throw(IllegalArgumentException
, NoSuchElementException
, WrappedTargetException
, RuntimeException
, std::exception
)
214 ResettableMutexGuard
aGuard(m_aMutex
);
218 // let derived classes approve the new object
219 Reference
< XContent
> xNewElement(aElement
,UNO_QUERY
);
220 approveNewObject( _rName
, xNewElement
); // will throw if necessary
222 // the old element (for the notifications)
223 Reference
< XContent
> xOldElement
= implGetByName( _rName
, impl_haveAnyListeners_nothrow() );
225 notifyByName( aGuard
, _rName
, xNewElement
, xOldElement
, E_REPLACED
, ApproveListeners
);
226 implReplace( _rName
, xNewElement
);
227 notifyByName( aGuard
, _rName
, xNewElement
, xOldElement
, E_REPLACED
, ContainerListemers
);
230 disposeComponent(xOldElement
);
232 catch (const RuntimeException
&)
236 catch (const NoSuchElementException
&)
240 catch (const WrappedTargetException
&)
244 catch (const Exception
& e
)
246 css::uno::Any
a(cppu::getCaughtException());
247 throw css::lang::WrappedTargetException(
248 "wrapped Exception " + e
.Message
,
249 css::uno::Reference
<css::uno::XInterface
>(), a
);
255 typedef Reference
< XVeto
> ( SAL_CALL
XContainerApproveListener::*ContainerApprovalMethod
)( const ContainerEvent
& );
257 struct RaiseExceptionFromVeto
260 ContainerApprovalMethod m_pMethod
;
261 const ContainerEvent
& m_rEvent
;
264 RaiseExceptionFromVeto( ContainerApprovalMethod _pMethod
, const ContainerEvent
& _rEvent
)
265 :m_pMethod( _pMethod
)
270 void operator()( const Reference
< XContainerApproveListener
>& _Listener
) const
272 Reference
< XVeto
> xVeto
= (_Listener
.get()->*m_pMethod
)( m_rEvent
);
276 Any eVetoDetails
= xVeto
->getDetails();
278 IllegalArgumentException aIllegalArgumentError
;
279 if ( eVetoDetails
>>= aIllegalArgumentError
)
280 throw aIllegalArgumentError
;
282 WrappedTargetException aWrappedError
;
283 if ( eVetoDetails
>>= aWrappedError
)
286 throw WrappedTargetException( xVeto
->getReason(), _Listener
.get(), eVetoDetails
);
291 void ODefinitionContainer::notifyByName( ResettableMutexGuard
& _rGuard
, const OUString
& _rName
,
292 const Reference
< XContent
>& _xNewElement
, const Reference
< XContent
>& _xOldElement
,
293 ContainerOperation _eOperation
, ListenerType _eType
)
295 bool bApprove
= ( _eType
== ApproveListeners
);
297 ::cppu::OInterfaceContainerHelper
& rContainer( bApprove
? m_aApproveListeners
: m_aContainerListeners
);
298 if ( !rContainer
.getLength() )
301 ContainerEvent
aEvent( *this, makeAny( _rName
), makeAny( _xNewElement
), makeAny( _xOldElement
) );
304 switch ( _eOperation
)
308 rContainer
.forEach
< XContainerApproveListener
, RaiseExceptionFromVeto
>(
309 RaiseExceptionFromVeto( &XContainerApproveListener::approveInsertElement
, aEvent
) );
311 rContainer
.notifyEach( &XContainerListener::elementInserted
, aEvent
);
315 rContainer
.forEach
< XContainerApproveListener
, RaiseExceptionFromVeto
>(
316 RaiseExceptionFromVeto( &XContainerApproveListener::approveReplaceElement
, aEvent
) );
318 rContainer
.notifyEach( &XContainerListener::elementReplaced
, aEvent
);
322 rContainer
.forEach
< XContainerApproveListener
, RaiseExceptionFromVeto
>(
323 RaiseExceptionFromVeto( &XContainerApproveListener::approveRemoveElement
, aEvent
) );
325 rContainer
.notifyEach( &XContainerListener::elementRemoved
, aEvent
);
333 void SAL_CALL
ODefinitionContainer::addContainerListener( const Reference
< XContainerListener
>& _rxListener
) throw(RuntimeException
, std::exception
)
335 if (_rxListener
.is())
336 m_aContainerListeners
.addInterface(_rxListener
);
339 void SAL_CALL
ODefinitionContainer::removeContainerListener( const Reference
< XContainerListener
>& _rxListener
) throw(RuntimeException
, std::exception
)
341 if (_rxListener
.is())
342 m_aContainerListeners
.removeInterface(_rxListener
);
345 void SAL_CALL
ODefinitionContainer::addContainerApproveListener( const Reference
< XContainerApproveListener
>& _Listener
) throw (RuntimeException
, std::exception
)
347 if ( _Listener
.is() )
348 m_aApproveListeners
.addInterface( _Listener
);
351 void SAL_CALL
ODefinitionContainer::removeContainerApproveListener( const Reference
< XContainerApproveListener
>& _Listener
) throw (RuntimeException
, std::exception
)
353 if ( _Listener
.is() )
354 m_aApproveListeners
.removeInterface( _Listener
);
358 Type SAL_CALL
ODefinitionContainer::getElementType( ) throw (RuntimeException
, std::exception
)
360 return cppu::UnoType
<XContent
>::get();
363 sal_Bool SAL_CALL
ODefinitionContainer::hasElements( ) throw (RuntimeException
, std::exception
)
365 MutexGuard
aGuard(m_aMutex
);
366 return !m_aDocuments
.empty();
369 // XEnumerationAccess
370 Reference
< XEnumeration
> SAL_CALL
ODefinitionContainer::createEnumeration( ) throw(RuntimeException
, std::exception
)
372 MutexGuard
aGuard(m_aMutex
);
373 return new ::comphelper::OEnumerationByIndex(static_cast<XIndexAccess
*>(this));
377 sal_Int32 SAL_CALL
ODefinitionContainer::getCount( ) throw(RuntimeException
, std::exception
)
379 MutexGuard
aGuard(m_aMutex
);
380 return m_aDocuments
.size();
383 Any SAL_CALL
ODefinitionContainer::getByIndex( sal_Int32 _nIndex
) throw(IndexOutOfBoundsException
, WrappedTargetException
, RuntimeException
, std::exception
)
385 MutexGuard
aGuard(m_aMutex
);
387 if ((_nIndex
< 0) || (_nIndex
>= (sal_Int32
)m_aDocuments
.size()))
388 throw IndexOutOfBoundsException();
390 Documents::iterator aPos
= m_aDocuments
[_nIndex
];
391 Reference
<XContent
> xProp
= aPos
->second
;
393 { // that's the first access to the object
395 xProp
= createObject(aPos
->first
);
396 aPos
->second
= Documents::mapped_type();
397 // and update the name-access map
400 return makeAny(xProp
);
403 Any SAL_CALL
ODefinitionContainer::getByName( const OUString
& _rName
) throw(NoSuchElementException
, WrappedTargetException
, RuntimeException
, std::exception
)
405 MutexGuard
aGuard(m_aMutex
);
407 return makeAny( implGetByName( _rName
, true ) );
410 Reference
< XContent
> ODefinitionContainer::implGetByName(const OUString
& _rName
, bool _bReadIfNecessary
) throw (NoSuchElementException
)
412 Documents::iterator aMapPos
= m_aDocumentMap
.find(_rName
);
413 if (aMapPos
== m_aDocumentMap
.end())
414 throw NoSuchElementException(_rName
,*this);
416 Reference
< XContent
> xProp
= aMapPos
->second
;
418 if (_bReadIfNecessary
&& !xProp
.is())
419 { // the object has never been accessed before, so we have to read it now
420 // (that's the expensive part)
422 // create the object and insert it into the map
423 xProp
= createObject(_rName
);
424 aMapPos
->second
= xProp
;
425 addObjectListener(xProp
);
431 Sequence
< OUString
> SAL_CALL
ODefinitionContainer::getElementNames( ) throw(RuntimeException
, std::exception
)
433 MutexGuard
aGuard(m_aMutex
);
435 Sequence
< OUString
> aNames(m_aDocumentMap
.size());
436 OUString
* pNames
= aNames
.getArray();
437 Documents::iterator aEnd
= m_aDocumentMap
.end();
438 for ( Documents::iterator aNameIter
= m_aDocumentMap
.begin();
440 ++pNames
, ++aNameIter
443 *pNames
= aNameIter
->first
;
449 sal_Bool SAL_CALL
ODefinitionContainer::hasByName( const OUString
& _rName
) throw(RuntimeException
, std::exception
)
451 MutexGuard
aGuard(m_aMutex
);
453 return checkExistence(_rName
);
456 void SAL_CALL
ODefinitionContainer::disposing( const EventObject
& _rSource
) throw(RuntimeException
, std::exception
)
458 MutexGuard
aGuard(m_aMutex
);
459 Reference
< XContent
> xSource(_rSource
.Source
, UNO_QUERY
);
460 // it's one of our documents ....
461 Documents::iterator aIter
= m_aDocumentMap
.begin();
462 Documents::iterator aEnd
= m_aDocumentMap
.end();
463 for (;aIter
!= aEnd
;++aIter
)
465 if ( xSource
== aIter
->second
.get() )
467 removeObjectListener(xSource
);
468 // and clear our document map/vector, so the object will be recreated on next access
469 aIter
->second
= Documents::mapped_type();
474 void ODefinitionContainer::implRemove(const OUString
& _rName
)
476 // from the object maps
477 Documents::iterator aFind
= m_aDocumentMap
.find(_rName
);
478 if ( aFind
!= m_aDocumentMap
.end() )
480 m_aDocuments
.erase( ::std::find(m_aDocuments
.begin(),m_aDocuments
.end(),aFind
));
481 m_aDocumentMap
.erase(aFind
);
483 getDefinitions().erase( _rName
);
485 notifyDataSourceModified();
491 bool lcl_ensureName( const Reference
< XContent
>& _rxContent
, const OUString
& _rName
)
493 if ( !_rxContent
.is() )
496 // obtain the current name. If it's the same as the new one,
500 Reference
< XPropertySet
> xProps( _rxContent
, UNO_QUERY
);
503 OUString sCurrentName
;
504 OSL_VERIFY( xProps
->getPropertyValue( PROPERTY_NAME
) >>= sCurrentName
);
505 if ( sCurrentName
.equals( _rName
) )
509 catch( const Exception
& )
511 OSL_FAIL( "lcl_ensureName: caught an exception while obtaining the current name!" );
515 Reference
< XRename
> xRename( _rxContent
, UNO_QUERY
);
516 OSL_ENSURE( xRename
.is(), "lcl_ensureName: invalid content (not renameable)!" );
521 xRename
->rename( _rName
);
524 catch( const Exception
& )
526 OSL_FAIL( "lcl_ensureName: caught an exception!" );
532 void ODefinitionContainer::implAppend(const OUString
& _rName
, const Reference
< XContent
>& _rxNewObject
)
534 MutexGuard
aGuard(m_aMutex
);
537 Reference
<XChild
> xChild(_rxNewObject
,UNO_QUERY
);
539 xChild
->setParent(static_cast<OWeakObject
*>(this));
541 ODefinitionContainer_Impl
& rDefinitions( getDefinitions() );
542 ODefinitionContainer_Impl::const_iterator aFind
= rDefinitions
.find( _rName
);
543 if ( aFind
== rDefinitions
.end() )
545 // ensure that the new object has the proper name.
546 // Somebody could create an object with name "foo", and insert it as "bar"
547 // into a container. In this case, we need to ensure that the object name
550 lcl_ensureName( _rxNewObject
, _rName
);
552 ::rtl::Reference
< OContentHelper
> pContent
= OContentHelper::getImplementation( _rxNewObject
);
555 TContentPtr pImpl
= pContent
->getImpl();
556 rDefinitions
.erase( pImpl
);
557 pImpl
->m_aProps
.aTitle
= _rName
;
558 rDefinitions
.insert( _rName
, pImpl
);
562 m_aDocuments
.push_back(m_aDocumentMap
.insert(Documents::value_type(_rName
,_rxNewObject
)).first
);
563 notifyDataSourceModified();
564 // now update our structures
565 if ( _rxNewObject
.is() )
566 addObjectListener(_rxNewObject
);
570 OSL_FAIL("ODefinitionContainer::implAppend: caught something !");
574 void ODefinitionContainer::implReplace(const OUString
& _rName
, const Reference
< XContent
>& _rxNewObject
)
576 OSL_ENSURE(checkExistence(_rName
), "ODefinitionContainer::implReplace : invalid name !");
578 Documents::iterator aFind
= m_aDocumentMap
.find(_rName
);
579 removeObjectListener(aFind
->second
);
580 aFind
->second
= _rxNewObject
;
581 addObjectListener(aFind
->second
);
584 void ODefinitionContainer::approveNewObject(const OUString
& _sName
,const Reference
< XContent
>& _rxObject
) const
586 // check the arguments
587 if ( _sName
.isEmpty() )
588 throw IllegalArgumentException(
589 DBA_RES( RID_STR_NAME_MUST_NOT_BE_EMPTY
),
593 if ( m_bCheckSlash
&& _sName
.indexOf( '/' ) != -1 )
594 throw IllegalArgumentException(
595 m_aErrorHelper
.getErrorMessage( ErrorCondition::DB_OBJECT_NAME_WITH_SLASHES
),
599 if ( !_rxObject
.is() )
600 throw IllegalArgumentException(
601 DBA_RES( RID_STR_NO_NULL_OBJECTS_IN_CONTAINER
),
605 const ODefinitionContainer_Impl
& rDefinitions( getDefinitions() );
606 if ( rDefinitions
.find( _sName
) != rDefinitions
.end() )
607 throw ElementExistException(
608 DBA_RES( RID_STR_NAME_ALREADY_USED
),
611 ::rtl::Reference
< OContentHelper
> pContent( OContentHelper::getImplementation( _rxObject
) );
612 if ( !pContent
.is() )
613 throw IllegalArgumentException(
614 DBA_RES( RID_STR_OBJECT_CONTAINER_MISMATCH
),
618 if ( rDefinitions
.find( pContent
->getImpl() ) != rDefinitions
.end() )
619 throw ElementExistException(
620 DBA_RES( RID_STR_OBJECT_ALREADY_CONTAINED
),
624 // XPropertyChangeListener
625 void SAL_CALL
ODefinitionContainer::propertyChange( const PropertyChangeEvent
& evt
) throw (RuntimeException
, std::exception
)
627 ClearableMutexGuard
aGuard(m_aMutex
);
628 if( evt
.PropertyName
== PROPERTY_NAME
|| evt
.PropertyName
== "Title" )
630 m_bInPropertyChange
= true;
633 OUString sNewName
,sOldName
;
634 evt
.OldValue
>>= sOldName
;
635 evt
.NewValue
>>= sNewName
;
636 Reference
<XContent
> xContent( evt
.Source
, UNO_QUERY
);
637 removeObjectListener( xContent
);
638 implRemove( sOldName
);
639 implAppend( sNewName
, xContent
);
641 catch(const Exception
&)
643 DBG_UNHANDLED_EXCEPTION();
644 throw RuntimeException();
646 m_bInPropertyChange
= false;
650 // XVetoableChangeListener
651 void SAL_CALL
ODefinitionContainer::vetoableChange( const PropertyChangeEvent
& aEvent
) throw (PropertyVetoException
, RuntimeException
, std::exception
)
653 MutexGuard
aGuard(m_aMutex
);
655 if( aEvent
.PropertyName
== PROPERTY_NAME
|| aEvent
.PropertyName
== "Title" )
658 aEvent
.NewValue
>>= sNewName
;
659 if(hasByName(sNewName
))
660 throw PropertyVetoException();
664 void ODefinitionContainer::addObjectListener(const Reference
< XContent
>& _xNewObject
)
666 OSL_ENSURE(_xNewObject
.is(),"ODefinitionContainer::addObjectListener: Object is null!");
667 Reference
<XPropertySet
> xProp(_xNewObject
,UNO_QUERY
);
670 xProp
->addPropertyChangeListener(PROPERTY_NAME
, this);
671 xProp
->addVetoableChangeListener(PROPERTY_NAME
, this);
675 void ODefinitionContainer::removeObjectListener(const Reference
< XContent
>& _xNewObject
)
677 Reference
<XPropertySet
> xProp(_xNewObject
,UNO_QUERY
);
680 xProp
->removePropertyChangeListener(PROPERTY_NAME
, this);
681 xProp
->removeVetoableChangeListener(PROPERTY_NAME
, this);
685 bool ODefinitionContainer::checkExistence(const OUString
& _rName
)
687 return m_aDocumentMap
.find(_rName
) != m_aDocumentMap
.end();
692 // namespace dbaccess
693 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */