2 Copyright (C) 1998-99 Paul Barton-Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __stl_functors_h__
21 #define __stl_functors_h__
25 #include "pbd/libpbd_visibility.h"
28 struct LIBPBD_API less<std::string *> {
29 bool operator()(std::string *s1, std::string *s2) const {
34 #endif // LESS_STRING_P
36 #ifndef LESS_CONST_STRING_P
37 struct LIBPBD_API less<const std::string *> {
38 bool operator()(const std::string *s1, const std::string *s2) const {
42 #define LESS_CONST_STRING_P
43 #endif // LESS_CONST_STRING_P
45 #ifndef LESS_CONST_CHAR_P
46 struct LIBPBD_API less<const char *>
48 bool operator()(const char* s1, const char* s2) const {
49 return strcmp(s1, s2) < 0;
52 #define LESS_CONST_CHAR_P
53 #endif // LESS_CONST_CHAR_P
55 #ifndef LESS_CONST_FLOAT_P
56 struct LIBPBD_API less<const float *>
58 bool operator()(const float *n1, const float *n2) const {
62 #define LESS_CONST_FLOAT_P
63 #endif // LESS_CONST_FLOAT_P
65 #ifndef EQUAL_TO_CONST_CHAR_P
66 struct LIBPBD_API equal_to<const char *>
68 bool operator()(const char *s1, const char *s2) const {
69 return strcmp (s1, s2) == 0;
72 #define EQUAL_TO_CONST_CHAR_P
73 #endif // EQUAL_TO_CONST_CHAR_P
75 #ifndef EQUAL_TO_STRING_P
76 struct LIBPBD_API equal_to<std::string *>
78 bool operator()(const std::string *s1, const std::string *s2) const {
82 #define EQUAL_TO_STRING_P
83 #endif // EQUAL_TO_STRING_P
85 #ifndef LESS_CONST_STRING_R
86 struct LIBPBD_API less<const std::string &> {
87 bool operator() (const std::string &s1, const std::string &s2) {
91 #define LESS_CONST_STRING_R
92 #endif // EQUAL_TO_STRING_P
94 #endif // __stl_functors_h__