/*****************************************************************************
FILE:               Oracle7Buffer.h
LANGUAGE:           Objective-C
SYSTEM:             None
USER-INTERFACE:     None
DESCRIPTION
    $Header: /cvsroot/gnustep/gnustep/dev-libs/db/eoadaptors/Oracle7/Oracle7Buffer.h,v 1.2 2001/05/14 03:29:20 fedor Exp $
    This is the definition of the Oracle7Buffer class.

    The class Oracle7Buffer encapsulates an O2CI7Define and the buffer data
    passed to this define. It's able to convert data obtained from a fetch into
    OpenStep instances of NSNumber, NSString, NSDate, NSData.


AUTHORS
    <PJB>  Pascal J. Bourguignon  <pjb@imaginet.fr>
MODIFICATIONS
    $Log: Oracle7Buffer.h,v $
    Revision 1.2  2001/05/14 03:29:20  fedor
    Include fixes

    Revision 1.1  2000/02/22 16:27:13  pjb
    First release of the Oracle7Adaptor.

    1999/08/02 Creation.
BUGS
    - ...
LEGAL
    Written by:  Pascal J. Bourguignon <pjb@imaginet.fr>
    Funds from:  Orange Concept (http://www.orange-concept.com/)
    Date:        August 1999 - February 2000

    This file is part of the Oracle7 Adaptor, GNUstep Database Library.
    The Oracle7 Adaptor allows access to Oracle[678] databases from GDL.

    Copyright (C) 2000 Free Software Foundation, Inc.

    This  library is  free software;  you can  redistribute  it and/or
    modify it under the terms of the GNU Lesser General Public License
    as published by the Free  Software Foundation; either version 2 of
    the License, or (at your option) any later version.

    This library  is distributed in the  hope that it  will be useful,
    but  WITHOUT ANY WARRANTY;  without even  the implied  warranty of
    MERCHANTABILITY or FITNESS FOR  A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have  received a copy of the  GNU Lesser General Public
    License  along  with this  library;  if  not,  write to  the  Free
    Software  Foundation, Inc.,  59 Temple  Place, Suite  330, Boston,
    MA 02111-1307 USA
*****************************************************************************/
#ifndef __Oracle7Buffer_h__
#define __Oracle7Buffer_h__
#include <Foundation/NSCalendarDate.h>
#include <eoaccess/eoaccess.h>
#include <oci.h>

@class O2CI7Column; // is a private class.
@class O2CI7Cursor; // is a private class!


@interface Oracle7Buffer:NSObject
{
    O2CI7Column*        column; // source specification.
    void*               buffer;
    sb4                 bufferSize;
    ub2                 dataType;
    sb2                 indicator;
    ub2                 dataLength;
    ub2                 returnCode;
    EOAttribute*        attribute; // to know how to generate the value.
}

// NSObject methods:

    -(id)init;
        /*
            POST:       self is in mint condition.
        */

    -(void)dealloc;



// Oracle7Buffer methods:
    
    -(BOOL)defineForColumn:(O2CI7Column*)aColumn 
            atPosition:(ub4)position
            inCursor:(O2CI7Cursor*)aCursor
            asAttribute:(EOAttribute*)anAttribute;
        /*
            DO:         Set up the buffer for the column and define it in 
                        the cursor.

            NOTE:       The current implementation only define the buffer 
                        for one row. Therefore only one row at a time can 
                        be fetched.

            RETURN:     Whether the buffer is successfully set up.

            POST:       result <=> self is not in mint condition.
        */

    -(void)fillRow:(NSMutableDictionary*)row;
        /*
            PRE:        m=(self is in mint condition),
                        row=r.
            POST:       m  => row==r, 
                        !m => row==r U {([[self attribute]name],[self asValue])}
        */

    -(NSData*)asData;
    -(NSNumber*)asNumber;
    -(NSString*)asString;
    -(NSDate*)asDate;
    -(NSCalendarDate*)asCalendarDate;

@end //Oracle7Buffer;

#endif /*__Oracle7Buffer_h__*/

/*** Oracle7Buffer.h                  -- 2000-02-21 07:11:21 -- PJB ***/
