freFileDispatch.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   F.R.E.E. - flexible registration evaluation engine
00004 Version:   v.1.0.0
00005 Date:      $Date: 2006/09/01 12:00:00 $
00006 Module:    $RCSfile: freFileDispatch.cxx,v $
00007 Language:  C++
00008 
00009 
00010 
00011 Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012 Institute for Medical Biometry and Informatics, University of Heidelberg,
00013 Germany). All rights reserved.
00014 See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015 for details.
00016 
00017 This software is distributed WITHOUT ANY WARRANTY; without even 
00018 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019 PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 
00023 #include "freFileDispatch.h"
00024 
00025 #include "itksys/SystemTools.hxx"
00026 
00027 namespace FREE
00028 {
00029   std::string
00030   FileDispatch::
00031   GetName(const std::string& sFilePath)
00032   {
00033     std::string result = itksys::SystemTools::GetFilenameWithoutLastExtension(sFilePath);
00034     return result;
00035   };
00036 
00037   std::string
00038   FileDispatch::
00039   GetExtension(const std::string& sFilePath)
00040   {
00041     std::string result = itksys::SystemTools::GetFilenameLastExtension(sFilePath);
00042     return result;
00043   };
00044 
00045   std::string
00046   FileDispatch::
00047   GetFullName(const std::string& sFilePath)
00048   {
00049     std::string result = itksys::SystemTools::GetFilenameName(sFilePath);
00050     return result;
00051   };
00052 
00053   std::string
00054   FileDispatch::
00055   GetPath(const std::string& sFilePath)
00056   {
00057     std::string result = itksys::SystemTools::GetFilenamePath(sFilePath);
00058     return result;
00059 
00060   };
00061 
00062   std::string
00063   FileDispatch::
00064   GetName()
00065   {
00066     return GetName(m_sFileName);
00067   };
00068 
00069   std::string
00070   FileDispatch::
00071   GetExtension()
00072   {
00073     return GetExtension(m_sFileName);
00074   };
00075 
00076   std::string
00077   FileDispatch::
00078   GetFullName()
00079   {
00080     return GetFullName(m_sFileName);
00081   };
00082 
00083   std::string
00084   FileDispatch::
00085   GetPath()
00086   {
00087     return GetPath(m_sFileName);
00088   };
00089 
00090   FileDispatch::
00091   FileDispatch(const std::string& sFilePath)
00092   {
00093     m_sFileName = sFilePath;
00094   };
00095 
00100   std::string
00101   FileDispatch::
00102   CreateFullPath(const char* path, const char* file)
00103   {
00104     std::string ret;
00105 
00106   #ifdef _WIN32
00107     const char sep = '\\';
00108   #else
00109     const char sep = '/';
00110   #endif
00111 
00114     ret = path;
00115     if ( ret[ret.size()-1] != sep )
00116       {
00117       ret.append(1, sep);
00118       }
00119     ret.append(file);
00120     return ret;
00121   }
00122 }

Generated at Sat Oct 13 16:02:12 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000