]> git.mxchange.org Git - flightgear.git/blob - Bucket/bucketutils.hxx
Initial revision.
[flightgear.git] / Bucket / bucketutils.hxx
1 /**************************************************************************
2  * bucketutils.hxx -- support routines to handle fgBUCKET operations
3  *
4  * Written by Bernie Bright, started January 1998.
5  *
6  * Copyright (C) 1998  Bernie Bright - bbright@c031.aone.net.au
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  * $Id$
23  * (Log is kept at end of this file)
24  **************************************************************************/
25
26
27 #ifndef _BUCKETUTILS_HXX
28 #define _BUCKETUTILS_HXX
29
30 #include <string>
31
32 #include "bucketutils.h"
33
34 #include <Include/compiler.h>
35 FG_USING_STD(string);
36
37 inline bool
38 operator== ( const fgBUCKET& b1, const fgBUCKET& b2 )
39 {
40     return ( b1.lon == b2.lon &&
41              b1.lat == b2.lat &&
42              b1.x == b2.x &&
43              b1.y == b2.y );
44 }
45
46 inline string
47 fgBucketGenIndex( const fgBUCKET& p )
48 {
49     char index_str[256];
50     sprintf( index_str, "%ld", fgBucketGenIndex( &p ) );
51     return string( index_str );
52 }
53
54 inline string
55 fgBucketGenBasePath( const fgBUCKET& p )
56 {
57     char base_path[256];
58     fgBucketGenBasePath( &p, base_path );
59     return string( base_path );
60 }
61
62 inline ostream&
63 operator<< ( ostream& out, const fgBUCKET& b )
64 {
65     return out << b.lon << "," << b.lat << " " << b.x << "," << b.y;
66 }
67
68 #endif /* _BUCKETUTILS_HXX */
69
70
71 // $Log$
72 // Revision 1.1  1998/11/09 23:42:12  curt
73 // Initial revision.
74 //
75
76