1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef CONNECTIVITY_TKEYVALUE_HXX
29 #define CONNECTIVITY_TKEYVALUE_HXX
31 #include "connectivity/FValue.hxx"
32 #include "connectivity/dbtoolsdllapi.hxx"
34 namespace connectivity
36 class OOO_DLLPUBLIC_DBTOOLS OKeyValue
39 ::std::vector
<ORowSetValueDecoratorRef
> m_aKeys
;
44 OKeyValue(sal_Int32 nVal
);
49 inline static void * SAL_CALL
operator new( size_t nSize
) SAL_THROW(())
50 { return ::rtl_allocateMemory( nSize
); }
51 inline static void * SAL_CALL
operator new( size_t,void* _pHint
) SAL_THROW(())
53 inline static void SAL_CALL
operator delete( void * pMem
) SAL_THROW(())
54 { ::rtl_freeMemory( pMem
); }
55 inline static void SAL_CALL
operator delete( void *,void* ) SAL_THROW(())
58 static OKeyValue
* createKeyValue(sal_Int32 nVal
);
59 // static OKeyValue* createEmptyKeyValue();
61 inline void pushKey(const ORowSetValueDecoratorRef
& _aValueRef
)
63 m_aKeys
.push_back(_aValueRef
);
65 inline void setValue(sal_Int32 nVal
) { m_nValue
= nVal
; }
67 ::rtl::OUString
getKeyString(::std::vector
<ORowSetValueDecoratorRef
>::size_type i
) const
69 OSL_ENSURE(m_aKeys
.size() > i
,"Wrong index for KEyValue");
70 return m_aKeys
[i
]->getValue();
72 double getKeyDouble(::std::vector
<ORowSetValueDecoratorRef
>::size_type i
) const
74 OSL_ENSURE(m_aKeys
.size() > i
,"Wrong index for KEyValue");
75 return m_aKeys
[i
]->getValue();
78 inline sal_Int32
getValue() const { return m_nValue
; }
82 #endif // CONNECTIVITY_TKEYVALUE_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */