Date: | 2009-10-30 13:44:51 (14 years 4 months ago) |
---|---|
Author: | Mirko Lindner |
Commit: | d82627dc081ef0704f11b45b896b35738528e73a |
Message: | get namespace from url -- not perfect Signed-off-by: Mirko Lindner <mirko@qi-hardware.com> |
Files: |
src/vido.cc (2 diffs) |
Change Details
src/vido.cc | ||
---|---|---|
100 | 100 | |
101 | 101 | // // replace '+' signs with spaces in url |
102 | 102 | std::replace(term.begin(), term.end(), '+', ' '); |
103 | ||
104 | // // declare namespace | |
105 | char *ns = "A"; | |
103 | ||
104 | // // find and declare namespace | |
105 | size_t found; | |
106 | size_t found2; | |
107 | char *ns; | |
108 | ||
109 | found=term.find("/"); | |
110 | if (found!=std::string::npos){ | |
111 | if (found != (int) 0){ | |
112 | ns = &term[0]; | |
113 | }else{ | |
114 | term = term.substr(1, strlen(url)); | |
115 | ns = &term[0]; | |
116 | found2 = term.find("/"); | |
117 | term = term.substr(found2 + 1, strlen(url)); | |
118 | } | |
119 | }else{ | |
120 | ns = "A"; | |
121 | } | |
106 | 122 | |
107 | 123 | // // try to retrieve article |
108 | 124 | try { |
... | ... | |
129 | 145 | |
130 | 146 | // // load new data into gtkhtml widget |
131 | 147 | gtk_html_load_from_string(GTK_HTML(html_wg), str2.c_str(), -1); |
132 | // std::cout<<term<<".\n"; | |
148 | std::cout<<"term:"<<term<<".\n"; | |
149 | std::cout<<"url:"<<url<<".\n"; | |
133 | 150 | }catch(...){ |
134 | 151 | } |
135 | 152 | } |
Branches:
development
master