head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.40; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.57; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.04; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.22.00; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# sg_path.hxx

Go to the documentation of this file.

    00001
    00007 // Written by Curtis L. Olson, started April 1999.
    00008 //
    00009 // Copyright (C) 1999  Curtis L. Olson - curt@@flightgear.org
    00010 //
    00011 // This library is free software; you can redistribute it and/or
    00012 // modify it under the terms of the GNU Library General Public
    00013 // License as published by the Free Software Foundation; either
    00014 // version 2 of the License, or (at your option) any later version.
    00015 //
    00016 // This library is distributed in the hope that it will be useful,
    00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00019 // Library General Public License for more details.
    00020 //
    00021 // You should have received a copy of the GNU Library General Public
    00022 // License along with this library; if not, write to the
    00023 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00024 // Boston, MA  02111-1307, USA.
    00025 //
    00026 // $Id: sg_path.hxx,v 1.3 2002/02/04 20:23:41 curt Exp $
    00027
    00028
    00029 #ifndef _SG_PATH_HXX
    00030 #define _SG_PATH_HXX
    00031
    00032
    00033 #include <simgear/compiler.h>
    00034
    00035 #include STL_STRING
    00036
    00037 SG_USING_STD(string);
    00038
    00039
    00040 #ifdef macintosh
    00041 #  define SG_PATH_SEP ':'
    00042 #  define SG_BAD_PATH_SEP '/'
    00043 #else
    00044 #  define SG_PATH_SEP '/'
    00045 #  define SG_BAD_PATH_SEP ':'
    00046 #endif
    00047
    00048
    00057 class SGPath {
    00058
    00059 private:
    00060
    00061     string path;
    00062
    00063 public:
    00064
    00066     SGPath();
    00067
    00072     SGPath( const string& p );
    00073
    00075     ~SGPath();
    00076
    00081     void set( const string& p );
    00082     SGPath& operator= ( const char* p ) { this->set(p); return *this; }
    00083
    00088     void append( const string& p );
    00089
    00095     void concat( const string& p );
    00096
    00101     string dir();
    00102
    00106     string str() const { return path; }
    00107
    00111     const char* c_str() { return path.c_str(); }
    00112
    00117     bool exists() const;
    00118
    00119 private:
    00120
    00121     void fix();
    00122
    00123 };
    00124
    00125
    00126 #endif // _SG_PATH_HXX
    00127
    00128

@ 1.3 log @Oops, try again. @ text @d91 1 a91 1