/*****************************************************************************
FILE:               NSString-Oracle7Adaptor_LongLong.m
LANGUAGE:           Objective-C
SYSTEM:             None
USER-INTERFACE:     None
DESCRIPTION
    $Header: /cvsroot/gnustep/gnustep/dev-libs/db/eoadaptors/Oracle7/NSString-Oracle7Adaptor_LongLong.m,v 1.1 2000/02/22 16:27:13 pjb Exp $
    This is the implementation of the NSString-Oracle7Adaptor_LongLong class.
    The class NSString-Oracle7Adaptor_LongLong is xxxxxx.
    The implementation of the class NSString-Oracle7Adaptor_LongLong xxxxxxx.

AUTHORS
    <PJB>  Pascal J. Bourguignon  <pjb@imaginet.fr>
MODIFICATIONS
    $Log: NSString-Oracle7Adaptor_LongLong.m,v $
    Revision 1.1  2000/02/22 16:27:13  pjb
    First release of the Oracle7Adaptor.

    1999/08/03 Creation.
BUGS
    - It's not implemented yet.
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
*****************************************************************************/
#include <NSString-Oracle7Adaptor_LongLong.h>


@implementation NSString(Oracle7Adaptor_LongLong)

    static const char* rcsid="$Id";

    -(long long)oracle7AdaptorLongLongValue
    {
        long long powerOfTen=10LL;
        long long value=0LL;
        BOOL negative=NO;
        unsigned int i=0;
        unsigned int count=[self length];
        unichar      digit=[self characterAtIndex:i];
        
        if(digit==(unichar)'+'){
            i++;
        }else if(digit==(unichar)'-'){
            i++;
            negative=YES;
        }
        while(i<count){
            unichar digit=[self characterAtIndex:i];
            if((((unichar)'0')<=digit)&&(digit<=((unichar)'9'))){
                value=(value*powerOfTen)+(long long)(digit-(unichar)'0');
            }else{
                break;
            }
            i++;
        }
        if(negative){
            return(-value);
        }else{
            return(value);
        }
    }//oracle7AdaptorLongLongValue;


@end //NSString(Oracle7Adaptor_LongLong);


/*** NSString-Oracle7Adaptor_LongLong.m -- 2000-02-21 07:11:18 -- PJB ***/
