summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 696562d)
raw | patch | inline | side by side (parent: 696562d)
author | ishmal <ishmal@users.sourceforge.net> | |
Sat, 22 Apr 2006 21:50:44 +0000 (21:50 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Sat, 22 Apr 2006 21:50:44 +0000 (21:50 +0000) |
src/dom/work/testuri.cpp | patch | blob | history |
index 2e061997bf9e32a9d44d7dd8d1b8e5aa53703983..2754af76a8f252d005bb65561733dcac692be90c 100644 (file)
--- a/src/dom/work/testuri.cpp
+++ b/src/dom/work/testuri.cpp
* Authors:
* Bob Jamison
*
- * Copyright (C) 2005 Bob Jamison
+ * Copyright (C) 2006 Bob Jamison
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include "io/uristream.h"
-
+typedef org::w3c::dom::URI URI;
static bool doURI(char *uristr)
{
printf("path : '%s'\n", uri.getPath().c_str());
printf("query : '%s'\n", uri.getQuery().c_str());
printf("fragment: '%s'\n", uri.getFragment().c_str());
- printf("absolute: '%d'\n", uri.getIsAbsolute());
-
-
-
-
+ printf("absolute: '%d'\n", uri.isAbsolute());
+ printf("opaque : '%d'\n", uri.isOpaque());
return true;
}
-static bool doTest()
+
+
+static bool test1()
{
char *uristr = "http://www.mit.edu:80/index.html?test=good#hello";
doURI(uristr);
uristr = "http://www.mit.edu:80";
doURI(uristr);
+ return true;
+}
-
-
-
-
-
+static bool test2()
+{
+ printf("############ uri.resolve() #######\n");
+ URI absUri("file:/this/is/an/./absolute/path.sfx");
+ printf("absUri:%s\n", absUri.getPath().c_str());
+ URI relUri("../this/is/a/./relative/path.sfx");
+ printf("relUri:%s\n", relUri.getPath().c_str());
+ URI resUri = absUri.resolve(relUri);
+ printf("resUri:%s\n", resUri.getPath().c_str());
return true;
}
int main(int argc, char **argv)
{
- if (!doTest())
+ if (!test1())
+ return 1;
+ if (!test2())
return 1;
return 0;
}