]> git.saurik.com Git - apple/security.git/blame - Keychain/KCCursor.h
Security-163.tar.gz
[apple/security.git] / Keychain / KCCursor.h
CommitLineData
bac41a7b 1/*
29654253 2 * Copyright (c) 2000-2002 Apple Computer, Inc. All Rights Reserved.
bac41a7b
A
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
29654253
A
18//
19// KCCursor.h
20//
21#ifndef _SECURITY_KCCURSOR_H_
22#define _SECURITY_KCCURSOR_H_
bac41a7b
A
23
24#include <Security/StorageManager.h>
25
26namespace Security
27{
28
29namespace KeychainCore
30{
31
29654253 32class KCCursorImpl : public SecCFObject, public CssmAutoQuery
bac41a7b
A
33{
34 NOCOPY(KCCursorImpl)
29654253 35public:
df0e469f
A
36 SECCFFUNCTIONS(KCCursorImpl, SecKeychainSearchRef, errSecInvalidSearchRef)
37
bac41a7b
A
38 friend class KCCursor;
39protected:
29654253
A
40 KCCursorImpl(const StorageManager::KeychainList &searchList, SecItemClass itemClass, const SecKeychainAttributeList *attrList);
41 KCCursorImpl(const StorageManager::KeychainList &searchList, const SecKeychainAttributeList *attrList);
bac41a7b
A
42
43public:
df0e469f 44 virtual ~KCCursorImpl() throw();
bac41a7b
A
45 bool next(Item &item);
46
47private:
29654253
A
48 StorageManager::KeychainList mSearchList;
49 StorageManager::KeychainList::iterator mCurrent;
bac41a7b 50 CssmClient::DbCursor mDbCursor;
df0e469f 51 bool mAllFailed;
bac41a7b
A
52};
53
54
df0e469f 55class KCCursor : public SecPointer<KCCursorImpl>
bac41a7b
A
56{
57public:
58 KCCursor() {}
59
df0e469f 60 KCCursor(KCCursorImpl *impl) : SecPointer<KCCursorImpl>(impl) {}
bac41a7b 61
29654253 62 KCCursor(const StorageManager::KeychainList &searchList, const SecKeychainAttributeList *attrList)
df0e469f 63 : SecPointer<KCCursorImpl>(new KCCursorImpl(searchList, attrList)) {}
bac41a7b 64
29654253 65 KCCursor(const StorageManager::KeychainList &searchList, SecItemClass itemClass, const SecKeychainAttributeList *attrList)
df0e469f 66 : SecPointer<KCCursorImpl>(new KCCursorImpl(searchList, itemClass, attrList)) {}
bac41a7b
A
67
68 typedef KCCursorImpl Impl;
69};
70
71
bac41a7b
A
72} // end namespace KeychainCore
73
74} // end namespace Security
75
29654253 76#endif // !_SECURITY_KCCURSOR_H_