]> git.mxchange.org Git - simgear.git/blob - Bucket/bucketutils.hxx
MSVC++ portability changes by Bernie Bright:
[simgear.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 FG_USING_NAMESPACE(std);
33
34 #include "bucketutils.h"
35
36 #include <Include/compiler.h>
37 FG_USING_STD(string);
38
39 inline bool
40 operator== ( const fgBUCKET& b1, const fgBUCKET& b2 )
41 {
42     return ( b1.lon == b2.lon &&
43              b1.lat == b2.lat &&
44              b1.x == b2.x &&
45              b1.y == b2.y );
46 }
47
48 inline string
49 fgBucketGenIndex( const fgBUCKET& p )
50 {
51     char index_str[256];
52     sprintf( index_str, "%ld", fgBucketGenIndex( &p ) );
53     return string( index_str );
54 }
55
56 inline string
57 fgBucketGenBasePath( const fgBUCKET& p )
58 {
59     char base_path[256];
60     fgBucketGenBasePath( &p, base_path );
61     return string( base_path );
62 }
63
64 inline ostream&
65 operator<< ( ostream& out, const fgBUCKET& b )
66 {
67     return out << b.lon << "," << b.lat << " " << b.x << "," << b.y;
68 }
69
70 #endif /* _BUCKETUTILS_HXX */
71
72
73 // $Log$
74 // Revision 1.2  1999/01/19 20:56:53  curt
75 // MacOS portability changes contributed by "Robert Puyol" <puyol@abvent.fr>
76 //
77 // Revision 1.1  1998/11/09 23:42:12  curt
78 // Initial revision.
79 //
80
81