]> git.mxchange.org Git - simgear.git/blob - Lib/Misc/fgpath.hxx
Fixed an IRIX warning message where an inline function is referenced
[simgear.git] / Lib / Misc / fgpath.hxx
1 //
2 // fgpath.hxx -- routines to abstract out path separator differences
3 //               between MacOS and the rest of the world
4 //
5 // Written by Curtis L. Olson, started April 1999.
6 //
7 // Copyright (C) 1999  Curtis L. Olson - curt@flightgear.org
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 //
23 // $Id$
24
25
26 #ifndef _FGPATH_HXX
27 #define _FGPATH_HXX
28
29
30 #include <Include/compiler.h>
31
32 #include STL_STRING
33
34 FG_USING_STD(string);
35
36
37 #ifdef MACOS
38 #  define FG_PATH_SEP ':'
39 #  define FG_BAD_PATH_SEP '/'
40 #else
41 #  define FG_PATH_SEP '/'
42 #  define FG_BAD_PATH_SEP ':'
43 #endif
44
45
46 class FGPath {
47
48 private:
49
50     string path;
51
52 public:
53
54     // default constructor
55     FGPath();
56
57     // create a path based on "path"
58     FGPath( const string p );
59
60     // destructor
61     ~FGPath();
62
63     // set path
64     void set( const string p );
65
66     // append another piece to the existing path
67     void append( const string p );
68
69     // concatenate a string to the end of the path without inserting a
70     // path separator
71     void concat( const string p );
72
73     // get the path string
74     inline string str() const { return path; }
75     inline const char *c_str() { return path.c_str(); }
76 };
77
78
79 #endif // _FGPATH_HXX
80
81