2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $XConsortium: dict_driver.cc /main/3 1996/06/11 16:42:53 cde-hal $
29 #include "Exceptions.hh"
30 #include "UAS_Exceptions.hh"
31 #include "UAS_String.hh"
34 #include "DictIter.hh"
40 Dict<UAS_String, int> map(NULL, 0);
45 cin.getline(string, 128);
46 while (! strlen(string)) {
47 cin.getline(string, 128);
49 if (strcasecmp(string, "end") == 0)
51 UAS_Pointer<UAS_String> uas_string
52 = new UAS_String(string, strlen(string), UAS_OWNER);
57 printf("map size = %d\n", map.size());
59 DictIter<UAS_String, int> mapiter;
60 for (mapiter = map.first(); mapiter() ;mapiter++) {
61 printf("%s, %d\n", (const char*)mapiter.key(), mapiter.value());