2 * Copyright (C) 2008 OpenedHand Ltd.
4 * Authors: Jorn Baayen <jorn@openedhand.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #include <libgupnp-av/gupnp-search-criteria-parser.h>
25 static const char * const searches[] = {
26 "dc:title contains \"foo\"",
27 "dc:title contains 'foo'",
28 "upnp:class = \"object.container.person.musicArtist\"",
29 "upnp:class = \"object.container.person.musicArtist\" and @refID exists false",
33 main (int argc, char **argv)
35 GUPnPSearchCriteriaParser *parser;
39 #if !GLIB_CHECK_VERSION (2, 35, 0)
43 parser = gupnp_search_criteria_parser_new ();
45 for (i = 0; i < G_N_ELEMENTS (searches); i++) {
47 gupnp_search_criteria_parser_parse_text (parser, searches[i], &error);
49 g_printerr ("\n\nCannot parse '%s': %s\n",
50 searches[i], error->message);
55 /* TODO: obviously an important next step is to verify that the
56 data was actually parsed correctly */