common.h

Go to the documentation of this file.
00001 /* -*- Mode: c++ -*- */
00002 /*
00003  *  this is part of Spm
00004  *
00005  *  Copyright (c) 2005 Guillaume Chevallereau
00006  *
00007  *  This program is free software. You can redistribute it and/or modify it 
00008  *  under the terms of the GNU General Public License as published by the 
00009  *  Free Software Foundation. Either version 2 of the license or (at your 
00010  *  option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be usefull but WITHOUT
00013  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
00014  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
00015  *  more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License along 
00018  *  with this program; if not, write to the Free Software Foundation, Inc., 
00019  *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
00020  */
00021 #ifndef __COMMON_H__
00022 #define __COMMON_H__
00023 
00024 #include <map>
00025 #include <algorithm>
00026 #include <string>
00027 #include <boost/filesystem/path.hpp>
00028 
00032 template <class T> struct equalKey : public std::binary_function<std::pair<std::string, T>, std::string,  bool>
00033 {
00034   bool operator() (std::pair<std::string, T> pair,
00035                    const std::string & otherKey) const
00036     {
00037       return pair.first == otherKey;
00038     }
00039 };
00040 
00045 bool equalEndOfLine (char c);
00046 
00051 bool equalComma (char c);
00052 
00057 bool equalBlank (char c);
00058 
00063 bool equalDot (char c);
00064 
00069 bool equalDollar (char c);
00070 
00075 bool equalPathSeparator (char c);
00076 
00081 struct equalPath : public std::binary_function<boost::filesystem::path, 
00082                                                boost::filesystem::path,
00083                                                bool>
00084 {
00085   bool operator() (boost::filesystem::path path1,
00086                    const boost::filesystem::path & path2) const;
00087 };
00088 
00093 struct equivalentPath : public std::binary_function<boost::filesystem::path, 
00094                                                     boost::filesystem::path,
00095                                                     bool>
00096 {
00097   bool operator() (boost::filesystem::path path1,
00098                    const boost::filesystem::path & path2) const;
00099 };
00100 #endif

Generated on Wed Jul 4 15:27:21 2007 for libSpm by  doxygen 1.4.6