Fawkes API Fawkes Development Version
qa_pathparser.cpp
1
2/***************************************************************************
3 * qa_pathparser.cpp - QA for PathParser
4 *
5 * Created: Mon Jul 07 14:04:46 2008
6 * Copyright 2005-2008 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24// Do not include in api reference
25///@cond QA
26
27#include <utils/system/pathparser.h>
28
29#include <cstdio>
30
31using namespace fawkes;
32
33int
34main(int argc, char **argv)
35{
36 printf("Trying /this/is/a/test/path foo/bar\n");
37 PathParser pp1("/this/is/a/test/path foo/bar");
38 pp1.print_debug();
39 printf("Re-generated: %s\n", pp1.path_as_string().c_str());
40
41 printf("Trying relative/path/test\n");
42 PathParser pp2("relative/path/test");
43 pp2.print_debug();
44 printf("Re-generated: %s\n", pp2.path_as_string().c_str());
45
46 printf("Trying relative/path/test/with/end/slash/\n");
47 PathParser pp3("relative/path/test/with/end/slash/");
48 pp3.print_debug();
49 printf("Re-generated: %s\n", pp3.path_as_string().c_str());
50
51 return 0;
52}
53
54/// @endcond
Path parser.
Definition: pathparser.h:33
Fawkes library namespace.