// sdutil.hpp -- Miscellaneous functions // // Written by Frederic Bouvier, started October 2001. // // Copyright (C) 2001 Frederic Bouvier - fredb@users.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version. // // This program 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 // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: sdutil.hpp,v 1.8 2005/05/09 07:02:14 fredb Exp $ #ifndef _sdutil_hpp_ #define _sdutil_hpp_ #include #include class FGSD_Util { public: enum Datum { D_UNKNOWN, D_WGS84, D_NAD27, D_NAD83, D_S42 }; static std::string buildRelativePath( const char *ref, const char *abspath, bool &rel ); static std::string buildAbsolutePath( const char *ref, const char *relpath ); static std::string getDirectoryFromFile( const char *fname ); static double parsePosition( const char *_pos_, bool &_error_ ); static std::string positionToString( double pos, bool lon ); static bool createPath( const char *path, bool lastIsFile ); static bool copyToFolder( const char *file, const char *folder ); static void splitPath( const std::string &path, std::list &pathList, char sep ); static bool isDir( const char *name ); static bool getWGS84PositionFromUTM( Datum _datum, double utm_x, double utm_y, long zone, double &latitude, double &longitude ); static bool getUTMPosition( Datum _datum, double &utm_x, double &utm_y, int &zone, double latitude, double longitude ); }; #endif