2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
24 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
25 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
26 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
27 /*%% $XConsortium: tt_client_isam_key_descriptor.h /main/3 1995/10/23 09:59:50 rswiston $ */
29 * tt_client_isam_key_descriptor.h - Defines the TT ISAM key descriptor class.
30 * This class is used to hold the information required
31 * to create a NetISAM key descriptor. It also makes
32 * it very easy to construct the descriptor.
34 * Copyright (c) 1992 by Sun Microsystems, Inc.
37 #ifndef _TT_CLIENT_ISAM_KEY_DESCRIPTOR_H
38 #define _TT_CLIENT_ISAM_KEY_DESCRIPTOR_H
40 #include "db/tt_client_isam.h"
41 #include "util/tt_object.h"
43 class _Tt_client_isam_key_descriptor : public _Tt_object {
45 _Tt_client_isam_key_descriptor ();
46 ~_Tt_client_isam_key_descriptor ();
48 void setCompress (bool_t flag)
51 keyDescriptor.k_flags |= COMPRESS;
54 keyDescriptor.k_flags &= (short) (0xFFFF - COMPRESS);
58 bool_t isCompressSet ()
60 return ((keyDescriptor.k_flags & COMPRESS) ? TRUE : FALSE);
63 void setDuplicates (bool_t flag)
66 keyDescriptor.k_flags &= (short) (0xFFFF - ISNODUPS);
67 keyDescriptor.k_flags |= ISDUPS;
70 keyDescriptor.k_flags &= (short) (0xFFFF - ISDUPS);
71 keyDescriptor.k_flags |= ISNODUPS;
75 bool_t isDuplicatesSet ()
77 return ((keyDescriptor.k_flags & ISDUPS) ? TRUE : FALSE);
80 short addKeyPart (short start, short length, short type);
81 short setKeyPart (short index, short start, short length, short type);
83 short getKeyPart (short index,
88 short getNumberOfParts () const
90 return keyDescriptor.k_nparts;
93 keydesc *getKeyDescriptor ()
95 return &keyDescriptor;
99 struct keydesc keyDescriptor;
101 friend class _Tt_client_isam_file;
104 #endif /* _TT_CLIENT_ISAM_KEY_DESCRIPTOR_H */