Doxygenifing.
#include <math.h>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
#include "newbucket.hxx"
hem, top_lon, pole, top_lat,
hem, main_lon, pole, main_lat);
- FGPath path( raw_path );
+ SGPath path( raw_path );
return path.str();
}
saturn = new Saturn;
uranus = new Uranus;
neptune = new Neptune;
- stars = new SGStarData( FGPath(path) );
+ stars = new SGStarData( SGPath(path) );
}
#include <string.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgpath.hxx>
#ifdef __BORLANDC__
# define exception c_exception
#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgstream.hxx>
+#include <simgear/misc/sgstream.hxx>
#include "stardata.hxx"
SGStarData::SGStarData() {
}
-SGStarData::SGStarData( FGPath path ) {
- data_path = FGPath( path );
+SGStarData::SGStarData( SGPath path ) {
+ data_path = SGPath( path );
load();
}
data_path.append( "stars" );
SG_LOG( SG_ASTRO, SG_INFO, " Loading stars from " << data_path.str() );
- fg_gzifstream in( data_path.str() );
+ sg_gzifstream in( data_path.str() );
if ( ! in.is_open() ) {
SG_LOG( SG_ASTRO, SG_ALERT, "Cannot open star file: "
<< data_path.str() );
#include <plib/sg.h>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
#define SG_MAX_STARS 850
int nstars;
sgdVec3 *stars;
- FGPath data_path;
+ SGPath data_path;
public:
// Constructor
SGStarData();
- SGStarData( FGPath path );
+ SGStarData( SGPath path );
// Destructor
~SGStarData();
#include <math.h>
-#include <simgear/misc/fgpath.hxx>
#include <simgear/magvar/magvar.hxx>
#include "coremag.hxx"
// depricated - #include <simgear/sg_zlib.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgstream.hxx>
+#include <simgear/misc/sgstream.hxx>
#include "interpolater.hxx"
SGInterpTable::SGInterpTable( const string& file ) {
SG_LOG( SG_MATH, SG_INFO, "Initializing Interpolator for " << file );
- fg_gzifstream in( file );
+ sg_gzifstream in( file );
if ( !in.is_open() ) {
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file );
exit(-1);
#include "MetarStation.h"
#include <algorithm>
-#include <simgear/misc/fgpath.hxx>
-
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(ostream);
SG_USING_STD(cout);
lib_LIBRARIES = libsgmisc.a
include_HEADERS = \
- fgpath.hxx \
- fgstream.hxx \
props.hxx \
+ sg_path.hxx \
+ sgstream.hxx \
stopwatch.hxx \
strutils.hxx \
texcoord.hxx \
zfstream.hxx
libsgmisc_a_SOURCES = \
- fgpath.cxx \
- fgstream.cxx \
props.cxx \
props_io.cxx \
+ sg_path.cxx \
+ sgstream.cxx \
strutils.cxx \
texcoord.cxx \
zfstream.cxx
+++ /dev/null
-//
-// fgpath.cxx -- routines to abstract out path separator differences
-// between MacOS and the rest of the world
-//
-// Written by Curtis L. Olson, started April 1999.
-//
-// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library 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
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-//
-// $Id$
-
-
-#include "fgpath.hxx"
-
-
-// If Unix, replace all ":" with "/". If MacOS, replace all "/" with
-// ":" it should go without saying that neither of these characters
-// should be used in file or directory names. In windoze, allow the
-// second character to be a ":" for things like c:\foo\bar
-
-static string fix_path( const string path ) {
- string result = path;
-
- for ( int i = 0; i < (int)path.size(); ++i ) {
-#if defined( WIN32 )
- // for windoze, don't replace the ":" for the second character
- if ( i == 1 ) {
- continue;
- }
-#endif
- if ( result[i] == FG_BAD_PATH_SEP ) {
- result[i] = FG_PATH_SEP;
- }
- }
-
- return result;
-}
-
-
-// default constructor
-FGPath::FGPath() {
- path = "";
-}
-
-
-// create a path based on "path"
-FGPath::FGPath( const string p ) {
- set( p );
-}
-
-
-// destructor
-FGPath::~FGPath() {
-}
-
-
-// set path
-void FGPath::set( const string p ) {
- path = fix_path( p );
-}
-
-
-// append another piece to the existing path
-void FGPath::append( const string p ) {
- string part = fix_path( p );
-
- if ( path.size() == 0 ) {
- path = part;
- } else {
- if ( part[0] != FG_PATH_SEP ) {
- path += FG_PATH_SEP;
- }
- path += part;
- }
-}
-
-
-// concatenate a string to the end of the path without inserting a
-// path separator
-void FGPath::concat( const string p ) {
- string part = fix_path( p );
-
- if ( path.size() == 0 ) {
- path = part;
- } else {
- path += part;
- }
-}
-
-
-// get the directory part of the path.
-string FGPath::dir() {
- int index = path.rfind(FG_PATH_SEP);
- if (index >= 0) {
- return path.substr(0, index);
- } else {
- return "";
- }
-}
+++ /dev/null
-//
-// fgpath.hxx -- routines to abstract out path separator differences
-// between MacOS and the rest of the world
-//
-// Written by Curtis L. Olson, started April 1999.
-//
-// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library 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
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-//
-// $Id$
-
-
-#ifndef _FGPATH_HXX
-#define _FGPATH_HXX
-
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <simgear/compiler.h>
-
-#include STL_STRING
-
-SG_USING_STD(string);
-
-
-#ifdef macintosh
-# define FG_PATH_SEP ':'
-# define FG_BAD_PATH_SEP '/'
-#else
-# define FG_PATH_SEP '/'
-# define FG_BAD_PATH_SEP ':'
-#endif
-
-
-class FGPath {
-
-private:
-
- string path;
-
-public:
-
- // default constructor
- FGPath();
-
- // create a path based on "path"
- FGPath( const string p );
-
- // destructor
- ~FGPath();
-
- // set path
- void set( const string p );
-
- // append another piece to the existing path
- void append( const string p );
-
- // concatenate a string to the end of the path without inserting a
- // path separator
- void concat( const string p );
-
- // get the directory part of the path
- string dir();
-
- // get the path string
- inline string str() const { return path; }
- inline const char *c_str() { return path.c_str(); }
-};
-
-
-#endif // _FGPATH_HXX
-
-
#include <simgear/debug/logstream.hxx>
#include <simgear/xml/easyxml.hxx>
-#include "fgpath.hxx"
+#include "sg_path.hxx"
#include "props.hxx"
#include STL_IOSTREAM
// Check for an include.
const char * att_include = atts.getValue("include");
if (att_include != 0) {
- FGPath path(FGPath(_base).dir());
+ SGPath path(SGPath(_base).dir());
cerr << "Base is " << _base << endl;
- cerr << "Dir is " << FGPath(_base).dir() << endl;
+ cerr << "Dir is " << SGPath(_base).dir() << endl;
path.append(att_include);
if (!readProperties(path.str(), node)) {
SG_LOG(SG_INPUT, SG_ALERT, "Failed to read include file "
--- /dev/null
+// sg_path.cxx -- routines to abstract out path separator differences
+// between MacOS and the rest of the world
+//
+// Written by Curtis L. Olson, started April 1999.
+//
+// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library 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
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// $Id$
+
+
+#include "sg_path.hxx"
+
+
+// If Unix, replace all ":" with "/". If MacOS, replace all "/" with
+// ":" it should go without saying that neither of these characters
+// should be used in file or directory names. In windoze, allow the
+// second character to be a ":" for things like c:\foo\bar
+
+static string fix_path( const string path ) {
+ string result = path;
+
+ for ( int i = 0; i < (int)path.size(); ++i ) {
+#if defined( WIN32 )
+ // for windoze, don't replace the ":" for the second character
+ if ( i == 1 ) {
+ continue;
+ }
+#endif
+ if ( result[i] == SG_BAD_PATH_SEP ) {
+ result[i] = SG_PATH_SEP;
+ }
+ }
+
+ return result;
+}
+
+
+// default constructor
+SGPath::SGPath() {
+ path = "";
+}
+
+
+// create a path based on "path"
+SGPath::SGPath( const string p ) {
+ set( p );
+}
+
+
+// destructor
+SGPath::~SGPath() {
+}
+
+
+// set path
+void SGPath::set( const string p ) {
+ path = fix_path( p );
+}
+
+
+// append another piece to the existing path
+void SGPath::append( const string p ) {
+ string part = fix_path( p );
+
+ if ( path.size() == 0 ) {
+ path = part;
+ } else {
+ if ( part[0] != SG_PATH_SEP ) {
+ path += SG_PATH_SEP;
+ }
+ path += part;
+ }
+}
+
+
+// concatenate a string to the end of the path without inserting a
+// path separator
+void SGPath::concat( const string p ) {
+ string part = fix_path( p );
+
+ if ( path.size() == 0 ) {
+ path = part;
+ } else {
+ path += part;
+ }
+}
+
+
+// get the directory part of the path.
+string SGPath::dir() {
+ int index = path.rfind(SG_PATH_SEP);
+ if (index >= 0) {
+ return path.substr(0, index);
+ } else {
+ return "";
+ }
+}
--- /dev/null
+/**
+ * \file sg_path.hxx
+ * Routines to abstract out path separator differences between MacOS
+ * and the rest of the world.
+ */
+
+// Written by Curtis L. Olson, started April 1999.
+//
+// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library 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
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// $Id$
+
+
+#ifndef _SG_PATH_HXX
+#define _SG_PATH_HXX
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#include STL_STRING
+
+SG_USING_STD(string);
+
+
+#ifdef macintosh
+# define SG_PATH_SEP ':'
+# define SG_BAD_PATH_SEP '/'
+#else
+# define SG_PATH_SEP '/'
+# define SG_BAD_PATH_SEP ':'
+#endif
+
+
+/**
+ * A class to hide path separator difference across platforms and assist
+ * in managing file system path names.
+ *
+ * Paths can be input in any platform format and will be converted
+ * automatically to the proper format.
+ */
+
+class SGPath {
+
+private:
+
+ string path;
+
+public:
+
+ /** Default constructor */
+ SGPath();
+
+ /**
+ * Construct a path based on the starting path provided.
+ * @param p initial path
+ */
+ SGPath( const string p );
+
+ /** Destructor */
+ ~SGPath();
+
+ /**
+ * Set path to a new value
+ * @param p new path
+ */
+ void set( const string p );
+
+ /**
+ * Append another piece to the existing path. Inserts a path
+ * separator between the existing component and the new component.
+ * @param p additional path component */
+ void append( const string p );
+
+ /**
+ * Concatenate a string to the end of the path without inserting a
+ * path separator.
+ * @param p addtional path suffix
+ */
+ void concat( const string p );
+
+ /**
+ * Get the directory part of the path.
+ * @return directory string
+ */
+ string dir();
+
+ /** Get the path string
+ * @return path string
+ */
+ inline string str() const { return path; }
+
+ /** Get the path string
+ * @return path in "C" string (ptr to char array) form.
+ */
+ inline const char *c_str() { return path.c_str(); }
+};
+
+
+#endif // _SG_PATH_HXX
+
+
--- /dev/null
+// zlib input file stream wrapper.
+//
+// Written by Bernie Bright, 1998
+//
+// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library 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
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// $Id$
+
+#include <ctype.h> // isspace()
+
+#ifdef SG_HAVE_STD_INCLUDES
+# include <cerrno>
+#else
+# include <errno.h>
+#endif
+
+#include "sgstream.hxx"
+
+sg_gzifstream::sg_gzifstream()
+ : istream(&gzbuf)
+{
+}
+
+//-----------------------------------------------------------------------------
+//
+// Open a possibly gzipped file for reading.
+//
+sg_gzifstream::sg_gzifstream( const string& name, ios_openmode io_mode )
+ : istream(&gzbuf)
+{
+ this->open( name, io_mode );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Attach a stream to an already opened file descriptor.
+//
+sg_gzifstream::sg_gzifstream( int fd, ios_openmode io_mode )
+ : istream(&gzbuf)
+{
+ gzbuf.attach( fd, io_mode );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Open a possibly gzipped file for reading.
+// If the initial open fails and the filename has a ".gz" extension then
+// remove the extension and try again.
+// If the initial open fails and the filename doesn't have a ".gz" extension
+// then append ".gz" and try again.
+//
+void
+sg_gzifstream::open( const string& name, ios_openmode io_mode )
+{
+ gzbuf.open( name.c_str(), io_mode );
+ if ( ! gzbuf.is_open() )
+ {
+ string s = name;
+ if ( s.substr( s.length() - 3, 3 ) == ".gz" )
+ {
+ // remove ".gz" suffix
+ s.replace( s.length() - 3, 3, "" );
+// s.erase( s.length() - 3, 3 );
+ }
+ else
+ {
+ // Append ".gz" suffix
+ s += ".gz";
+ }
+
+ // Try again.
+ gzbuf.open( s.c_str(), io_mode );
+ }
+}
+
+void
+sg_gzifstream::attach( int fd, ios_openmode io_mode )
+{
+ gzbuf.attach( fd, io_mode );
+}
+
+//
+// Manipulators
+//
+
+istream&
+skipeol( istream& in )
+{
+ char c = '\0';
+ // skip to end of line.
+
+#ifdef __MWERKS__
+ while ( in.get(c) && c != '\0' ) {
+#else
+ while ( in.get(c) ) {
+#endif
+ if ( (c == '\n') || (c == '\r') ) {
+ break;
+ }
+ }
+
+ return in;
+}
+
+istream&
+skipws( istream& in ) {
+ char c;
+#ifdef __MWERKS__
+ while ( in.get(c) && c != '\0' ) {
+#else
+ while ( in.get(c) ) {
+#endif
+
+#ifdef __MWERKS__
+ if ( ! isspace( c ) && c != '\n' ) {
+#else
+ if ( ! isspace( c ) ) {
+#endif
+ // put pack the non-space character
+ in.putback(c);
+ break;
+ }
+ }
+ return in;
+}
+
+istream&
+skipcomment( istream& in )
+{
+ while ( in )
+ {
+ // skip whitespace
+#ifdef __MWERKS__
+ in >> ::skipws;
+#else
+ in >> skipws;
+#endif
+
+ char c;
+ if ( in.get( c ) && c != '#' )
+ {
+ // not a comment
+ in.putback(c);
+ break;
+ }
+ in >> skipeol;
+ }
+ return in;
+}
+
--- /dev/null
+/**
+ * \file sgstream.hxx
+ * zlib input file stream wrapper.
+ */
+
+// Written by Bernie Bright, 1998
+//
+// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library 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
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// $Id$
+
+
+#ifndef _SGSTREAM_HXX
+#define _SGSTREAM_HXX
+
+#ifndef __cplusplus
+# error This library requires C++
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#if defined( SG_HAVE_STD_INCLUDES )
+# include <istream>
+#elif defined ( SG_HAVE_NATIVE_SGI_COMPILERS )
+# include <CC/stream.h>
+#elif defined ( __BORLANDC__ )
+# include <iostream>
+#else
+# include <istream.h>
+#endif
+
+#include STL_STRING
+
+#include <simgear/misc/zfstream.hxx>
+
+SG_USING_STD(string);
+
+#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
+SG_USING_STD(istream);
+#endif
+
+
+/**
+ * An envelope class for gzifstream.
+ */
+class sg_gzifstream : private gzifstream_base, public istream
+{
+public:
+ /** Default constructor */
+ sg_gzifstream();
+
+ /**
+ * Constructor that attempt to open a file with and without
+ * ".gz" extension.
+ * @param name name of file
+ * @param io_mode file open mode(s) "or'd" together
+ */
+ sg_gzifstream( const string& name,
+ ios_openmode io_mode = ios_in | ios_binary );
+
+ /**
+ * Constructor that attaches itself to an existing file descriptor.
+ * @param fd file descriptor
+ * @param io_mode file open mode(s) "or'd" together
+ */
+ sg_gzifstream( int fd, ios_openmode io_mode = ios_in|ios_binary );
+
+ /**
+ * Attempt to open a file with and without ".gz" extension.
+ * @param name name of file
+ * @param io_mode file open mode(s) "or'd" together
+ */
+ void open( const string& name,
+ ios_openmode io_mode = ios_in|ios_binary );
+
+ /**
+ * Attach to an existing file descriptor.
+ * @param fd file descriptor
+ * @param io_mode file open mode(s) "or'd" together
+ */
+ void attach( int fd, ios_openmode io_mode = ios_in|ios_binary );
+
+ /**
+ * Close the stream.
+ */
+ void close() { gzbuf.close(); }
+
+ /** @return true if the file is successfully opened, false otherwise. */
+ bool is_open() { return gzbuf.is_open(); }
+
+private:
+ // Not defined!
+ sg_gzifstream( const sg_gzifstream& );
+ void operator= ( const sg_gzifstream& );
+};
+
+/**
+ * \relates sg_gzifstream
+ * An istream manipulator that skips to end of line.
+ * @param in input stream
+ */
+istream& skipeol( istream& in );
+
+/**
+ * \relates sg_gzifstream
+ * An istream manipulator that skips over white space.
+ * @param in input stream
+ */
+istream& skipws( istream& in );
+
+/**
+ * \relates sg_gzifstream
+ * An istream manipulator that skips comments and white space.
+ * Ignores comments that start with '#'.
+ * @param in input stream
+ */
+istream& skipcomment( istream& in );
+
+
+#endif /* _SGSTREAM_HXX */
+
// build the moon object
-ssgBranch * SGMoon::build( FGPath path, double moon_size ) {
+ssgBranch * SGMoon::build( SGPath path, double moon_size ) {
// set up the orb state
path.append( "moon.rgba" );
#include <plib/ssg.h>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
class SGMoon {
~SGMoon( void );
// build the moon object
- ssgBranch *build( FGPath path, double moon_size );
+ ssgBranch *build( SGPath path, double moon_size );
// repaint the moon colors based on current value of moon_anglein
// degrees relative to verticle
// initialize the sun object and connect it into our scene graph root
-ssgBranch * SGSun::build( FGPath path, double sun_size ) {
+ssgBranch * SGSun::build( SGPath path, double sun_size ) {
// set up the orb state
orb_state = new ssgSimpleState();
#include <plib/ssg.h>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
class SGSun {
~SGSun( void );
// return the sun object
- ssgBranch *build( FGPath path, double sun_size );
+ ssgBranch *build( SGPath path, double sun_size );
// repaint the sun colors based on current value of sun_anglein
// degrees relative to verticle
post_root->addKid( post_selector );
// add the cloud ssgStates to the material lib
- FGPath cloud_path;
+ SGPath cloud_path;
cloud_path.set( tex_path.str() );
cloud_path.append( "overcast.rgb" );
#include <plib/ssg.h> // plib include
#include <simgear/compiler.h>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
#include <vector>
ssgSelector *pre_selector, *post_selector;
ssgTransform *pre_transform, *post_transform;
- FGPath tex_path;
+ SGPath tex_path;
// visibility
float visibility;
// specify the texture path (optional, defaults to current directory)
inline void texture_path( const string& path ) {
- tex_path = FGPath( path );
+ tex_path = SGPath( path );
}
// enable the sky
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
#include "sg_time.hxx"
#include "timezone.h"
// << asctime(localtime(&cur_time)) << endl;
if ( root != (string)"" ) {
- FGPath zone( root );
+ SGPath zone( root );
zone.append( "zone.tab" );
SG_LOG( SG_EVENT, SG_DEBUG, "Reading timezone info from: "
<< zone.str() );
GeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon );
GeoCoord* nearestTz = tzContainer->getNearest(location);
- FGPath name( root );
+ SGPath name( root );
name.append( nearestTz->getDescription() );
zonename = strdup( name.c_str() );
// cout << "Using zonename = " << zonename << endl;
time_t aircraftLocalTime;
GeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon );
GeoCoord* nearestTz = tzContainer->getNearest(location);
- FGPath zone( root );
+ SGPath zone( root );
zone.append ( nearestTz->getDescription() );
if ( zonename ) {
delete zonename;