TCFileName.h

Go to the documentation of this file.
00001 //*******************************************************************************
00002 //
00003 // *******   ***   ***               *
00004 //    *     *     *                  *
00005 //    *    *      *                *****
00006 //    *    *       ***  *   *   **   *    **    ***
00007 //    *    *          *  * *   *     *   ****  * * *
00008 //    *     *         *   *      *   * * *     * * *
00009 //    *      ***   ***    *     **   **   **   *   *
00010 //                        *
00011 //*******************************************************************************
00012 // see http://sourceforge.net/projects/tcsystem/ for details.
00013 // Copyright (C) 2003 - 2008 Thomas Goessler. All Rights Reserved. 
00014 //*******************************************************************************
00015 //
00016 // TCSystem is the legal property of its developers.
00017 // Please refer to the COPYRIGHT file distributed with this source distribution.
00018 // 
00019 // This library is free software; you can redistribute it and/or             
00020 // modify it under the terms of the GNU Lesser General Public                
00021 // License as published by the Free Software Foundation; either              
00022 // version 2.1 of the License, or (at your option) any later version.        
00023 //                                                                           
00024 // This library is distributed in the hope that it will be useful,           
00025 // but WITHOUT ANY WARRANTY; without even the implied warranty of            
00026 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         
00027 // Lesser General Public License for more details.                           
00028 //                                                                           
00029 // You should have received a copy of the GNU Lesser General Public          
00030 // License along with this library; if not, write to the Free Software       
00031 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
00032 //*******************************************************************************
00033 //  $Id: TCFileName.h 801 2008-01-23 19:46:25Z the_____tiger $
00034 //*******************************************************************************
00035 
00036 #ifndef _TC_FILE_NAME_H_
00037 #define _TC_FILE_NAME_H_
00038 
00039 #include "TCTypes.h"
00040 
00041 #include <string>
00042 #include <vector>
00043 
00044 namespace TC
00045 {
00061    namespace FileName
00062    {
00063       TCBASE_API std::string GetExtension(const std::string& file_name);
00064 
00065       TCBASE_API std::string GetName(const std::string& file_name);
00066 
00067       TCBASE_API std::string GetPath(const std::string& file_name);
00068 
00069       TCBASE_API void GetDirectoriesOfFileName(const std::string& file_name, 
00070                                                std::vector<std::string>& directories);
00071       TCBASE_API void GetDirectoriesOfPath(const std::string& path, 
00072                                            std::vector<std::string>& directories);
00073 
00074       TCBASE_API std::string AddFileNameAndExtension(const std::string& file_name, 
00075                                                      const std::string& extension);
00076       TCBASE_API std::string AddFileNameAndPath(const std::string& file_name,
00077                                                 const std::string& path);
00078       TCBASE_API std::string AddPaths(const std::string& path1, const std::string& path2);
00079 
00080       TCBASE_API std::string RemoveExtension(const std::string& file_name);
00081 
00104       TCBASE_API std::string Simplify(const std::string& file);
00105 
00106       extern const char  PATH_SEPERATOR;
00107       extern const char* PATH_SEPERATOR_STRING;
00108 
00109    } // namespace FileName
00110 
00115 } // namespace TC
00116 
00117 #endif // _TC_FILE_NAME_H_

Copyright (c) Thomas Goessler 2003 - 2008