Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

path.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: path.h,v 1.6 2003/11/14 14:05:54 fruit Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 
00022    Path
00023 
00024    HISTORY:
00025                 13.06.2002 MK
00026                         - initial version
00027                 31.08.2002 MK
00028                         - moved to salt
00029 */
00030 #ifndef SALT_PATH_H
00031 #define SALT_PATH_H
00032 
00033 #ifdef HAVE_CONFIG_H
00034 # ifdef PACKAGE_BUGREPORT
00035 #  undef PACKAGE_BUGREPORT
00036 # endif
00037 # ifdef PACKAGE_NAME
00038 #  undef PACKAGE_NAME
00039 # endif
00040 # ifdef PACKAGE_STRING
00041 #  undef PACKAGE_STRING
00042 # endif
00043 # ifdef PACKAGE_TARNAME
00044 #  undef PACKAGE_TARNAME
00045 # endif
00046 # ifdef PACKAGE_VERSION
00047 #  undef PACKAGE_VERSION
00048 # endif
00049 #include "config.h"
00050 #endif
00051 
00052 #include <string>
00053 #include <list>
00054 
00055 namespace salt
00056 {
00057 
00062 class Path
00063 {
00064     //
00065     // types
00066     //
00067 public:
00068     typedef std::list<std::string>      TStringList;
00069 
00070     //
00071     // functions
00072     //
00073 public:
00074 
00078     Path(const std::string &path = "");
00079 
00084     void Set(const std::string &path);
00085 
00089     bool IsAbsolute() const;
00090 
00092     const std::string& Front() const;
00093 
00095     void PopFront();
00096 
00098     const std::string& Back() const;
00099 
00101     void PopBack();
00102 
00106     bool IsEmpty() const;
00107 
00111     std::string GetCleanPath(const std::string &sep = "/") const;
00112 
00113 private:
00114     Path(const Path &obj);
00115     Path& operator=(const Path &obj);
00116 
00118     void Tokenize(const std::string &path);
00119 
00120     //
00121     // members
00122     //
00123 public:
00124 protected:
00126     TStringList mPathComponents;
00127 
00129     bool                mIsAbsolute;
00130 private:
00131 };
00132 
00133 } //namespace salt
00134 
00135 #endif //SALT_PATH_H

Generated on Thu Apr 6 15:25:39 2006 for rcssserver3d by  doxygen 1.4.4