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 .
19 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_TKEYVALUE_HXX
20 #define INCLUDED_CONNECTIVITY_SOURCE_INC_TKEYVALUE_HXX
22 #include <connectivity/FValue.hxx>
23 #include <connectivity/dbtoolsdllapi.hxx>
25 namespace connectivity
27 class OOO_DLLPUBLIC_DBTOOLS OKeyValue
30 ::std::vector
<ORowSetValueDecoratorRef
> m_aKeys
;
34 OKeyValue(sal_Int32 nVal
);
39 inline static void * SAL_CALL
operator new( size_t nSize
)
40 { return ::rtl_allocateMemory( nSize
); }
41 inline static void * SAL_CALL
operator new( size_t,void* _pHint
)
43 inline static void SAL_CALL
operator delete( void * pMem
)
44 { ::rtl_freeMemory( pMem
); }
45 inline static void SAL_CALL
operator delete( void *,void* )
48 static OKeyValue
* createKeyValue(sal_Int32 nVal
);
49 // static OKeyValue* createEmptyKeyValue();
51 inline void pushKey(const ORowSetValueDecoratorRef
& _aValueRef
)
53 m_aKeys
.push_back(_aValueRef
);
55 inline void setValue(sal_Int32 nVal
) { m_nValue
= nVal
; }
57 OUString
getKeyString(::std::vector
<ORowSetValueDecoratorRef
>::size_type i
) const
59 OSL_ENSURE(m_aKeys
.size() > i
,"Wrong index for KEyValue");
60 return m_aKeys
[i
]->getValue();
62 double getKeyDouble(::std::vector
<ORowSetValueDecoratorRef
>::size_type i
) const
64 OSL_ENSURE(m_aKeys
.size() > i
,"Wrong index for KEyValue");
65 return m_aKeys
[i
]->getValue();
68 inline sal_Int32
getValue() const { return m_nValue
; }
72 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_TKEYVALUE_HXX
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */