]> git.saurik.com Git - apple/security.git/blame - Keychain/KCCursor.h
Security-54.1.9.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:
bac41a7b
A
36 friend class KCCursor;
37protected:
29654253
A
38 KCCursorImpl(const StorageManager::KeychainList &searchList, SecItemClass itemClass, const SecKeychainAttributeList *attrList);
39 KCCursorImpl(const StorageManager::KeychainList &searchList, const SecKeychainAttributeList *attrList);
bac41a7b
A
40
41public:
42 virtual ~KCCursorImpl();
43 bool next(Item &item);
44
45private:
29654253
A
46 StorageManager::KeychainList mSearchList;
47 StorageManager::KeychainList::iterator mCurrent;
bac41a7b
A
48 CssmClient::DbCursor mDbCursor;
49};
50
51
52class KCCursor : public RefPointer<KCCursorImpl>
53{
54public:
55 KCCursor() {}
56
57 KCCursor(KCCursorImpl *impl) : RefPointer<KCCursorImpl>(impl) {}
58
29654253
A
59 KCCursor(const StorageManager::KeychainList &searchList, const SecKeychainAttributeList *attrList)
60 : RefPointer<KCCursorImpl>(new KCCursorImpl(searchList, attrList)) {}
bac41a7b 61
29654253
A
62 KCCursor(const StorageManager::KeychainList &searchList, SecItemClass itemClass, const SecKeychainAttributeList *attrList)
63 : RefPointer<KCCursorImpl>(new KCCursorImpl(searchList, itemClass, attrList)) {}
bac41a7b
A
64
65 typedef KCCursorImpl Impl;
66};
67
68
bac41a7b
A
69} // end namespace KeychainCore
70
71} // end namespace Security
72
29654253 73#endif // !_SECURITY_KCCURSOR_H_