source: sources/src/types.cc @ 1500:872b0b69e0d5

Revision 1500:872b0b69e0d5, 2.9 KB checked in by niam, 12 months ago (diff)

{issue #103} added implementation of sl- and dl- lists

Line 
1/***************************************************************************
2 *            types.cc
3 *
4 *  Tue Jul  10 2007
5 *  Copyright  2007  Dmytro Milinevskyy
6 *  milinevskyy@gmail.com
7 ****************************************************************************/
8
9/*
10 *  This program is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU Lesser General Public License version 2.1 as published by
12 *  the Free Software Foundation;
13 *
14 *  This program is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU Library General Public License for more details.
18 *
19 *  You should have received a copy of the GNU Lesser General Public License
20 *  along with this program; if not, write to the Free Software
21 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24/**
25 * vim indentation settings
26 * set tabstop=4
27 * set shiftwidth=4
28 */
29
30#include <libdodo/directives.h>
31
32#include <vector>
33#include <deque>
34#include <map>
35#include <string>
36#include <string.h>
37
38#include <libdodo/types.h>
39
40namespace dodo {
41    dodo::string __dodostring__;
42
43    //-------------------------------------------------------------------
44
45    dodoStringArray __dodostringarray__;
46
47    //-------------------------------------------------------------------
48
49    dodoStringMap __dodostringmap__;
50
51    //-------------------------------------------------------------------
52
53    dodoArray<dodoStringArray> __dodostringarrayarray__;
54
55    //-------------------------------------------------------------------
56
57    dodoStringMapArray __dodostringmaparray__;
58};
59
60//-------------------------------------------------------------------
61
62using namespace dodo;
63
64//-------------------------------------------------------------------
65
66bool
67dodoMapStringCompare::operator()(const dodo::string &first,
68                                 const dodo::string &second)
69{
70    return strcmp(first.data(), second.data()) < 0 ? true : false;
71}
72
73//-------------------------------------------------------------------
74
75bool
76dodoMapICaseStringCompare::operator()(const dodo::string &first,
77                                      const dodo::string &second)
78{
79    return strcasecmp(first.data(), second.data()) < 0 ? true : false;
80}
81
82//-------------------------------------------------------------------
83
84bool
85dodoMapStringCompare::operator()(const dodo::string &first,
86                                 const dodo::string &second) const
87{
88    return strcmp(first.data(), second.data()) < 0 ? true : false;
89}
90
91//-------------------------------------------------------------------
92
93bool
94dodoMapICaseStringCompare::operator()(const dodo::string &first,
95                                      const dodo::string &second) const
96{
97    return strcasecmp(first.data(), second.data()) < 0 ? true : false;
98}
99
100//-------------------------------------------------------------------
101
Note: See TracBrowser for help on using the repository browser.