From 0fec7b25991ab49140632e23399048a31f6e060b Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 9 Nov 1998 23:42:12 +0000 Subject: [PATCH] Initial revision. --- Bucket/bucketutils.hxx | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Bucket/bucketutils.hxx diff --git a/Bucket/bucketutils.hxx b/Bucket/bucketutils.hxx new file mode 100644 index 000000000..3145871ef --- /dev/null +++ b/Bucket/bucketutils.hxx @@ -0,0 +1,76 @@ +/************************************************************************** + * bucketutils.hxx -- support routines to handle fgBUCKET operations + * + * Written by Bernie Bright, started January 1998. + * + * Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id$ + * (Log is kept at end of this file) + **************************************************************************/ + + +#ifndef _BUCKETUTILS_HXX +#define _BUCKETUTILS_HXX + +#include + +#include "bucketutils.h" + +#include +FG_USING_STD(string); + +inline bool +operator== ( const fgBUCKET& b1, const fgBUCKET& b2 ) +{ + return ( b1.lon == b2.lon && + b1.lat == b2.lat && + b1.x == b2.x && + b1.y == b2.y ); +} + +inline string +fgBucketGenIndex( const fgBUCKET& p ) +{ + char index_str[256]; + sprintf( index_str, "%ld", fgBucketGenIndex( &p ) ); + return string( index_str ); +} + +inline string +fgBucketGenBasePath( const fgBUCKET& p ) +{ + char base_path[256]; + fgBucketGenBasePath( &p, base_path ); + return string( base_path ); +} + +inline ostream& +operator<< ( ostream& out, const fgBUCKET& b ) +{ + return out << b.lon << "," << b.lat << " " << b.x << "," << b.y; +} + +#endif /* _BUCKETUTILS_HXX */ + + +// $Log$ +// Revision 1.1 1998/11/09 23:42:12 curt +// Initial revision. +// + +