DeSR Dependency Parser |
00001 /* 00002 ** IXE C++ Library 00003 ** ixe/include/Set.h 00004 ** ---------------------------------------------------------------------- 00005 ** Copyright (c) 2000 Ideare SpA. 00006 ** Copyright (c) 2000 Giuseppe Attardi (attardi@di.unipi.it). 00007 ** ---------------------------------------------------------------------- 00008 ** 00009 ** This file is part of DeSR. 00010 ** 00011 ** DeSR is free software; you can redistribute it and/or modify it 00012 ** under the terms of the GNU General Public License, version 3, 00013 ** as published by the Free Software Foundation. 00014 ** 00015 ** DeSR is distributed in the hope that it will be useful, 00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 ** GNU General Public License for more details. 00019 ** 00020 ** You should have received a copy of the GNU General Public License 00021 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 ** ---------------------------------------------------------------------- 00023 */ 00024 00025 #ifndef IXE_Set_H 00026 #define IXE_Set_H 00027 00028 // Settings 00029 #include "platform.h" 00030 00031 // standard 00032 #include <set> 00033 #include <string> 00034 00035 // local 00036 #include "text/less.h" 00037 00038 namespace IXE { 00039 00048 template <class T> class Set : public std::set<T> 00049 { 00050 public: 00051 bool contains(T const &s) const { return this->find(s) != this->end(); } 00052 }; 00053 00061 template <> class Set<char const*> : public std::set<char const*> 00062 { 00063 public: 00064 bool contains(char const *s) const { return find(s) != this->end(); } 00065 }; 00066 00067 typedef Set<char const*> chars_set; 00068 00069 } // namespace IXE 00070 00071 #endif /* IXE_Set_H */