-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUHttpXPath.cpp
36 lines (27 loc) · 1.01 KB
/
UHttpXPath.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "UHttpXPath.hh"
// Register the UObject in the Urbi world.
UStart(UHttpXPath);
UHttpXPath::UHttpXPath(const std::string& name) : urbi::UObject(name) {
// Register the Urbi constructor.
// This is the only mandatory part of the C++ constructor.
UBindFunction(UHttpXPath, init);
}
int UHttpXPath::init() {
// Bind the functions, i.e., declare them to the Urbi world
// LOCK_INSTANCE Prevent parallel call to any function of this object..
UBindThreadedFunction(UHttpXPath, xPathQuery, urbi::LOCK_INSTANCE);
UBindThreadedFunction(UHttpXPath, performRequest, urbi::LOCK_INSTANCE);
UBindThreadedFunction(UHttpXPath, setHttpProxy, urbi::LOCK_INSTANCE);
return 0;
}
std::string UHttpXPath::xPathQuery(std::string xPathQuery) {
return httpxpath.xPathQuery(xPathQuery.c_str());
}
bool UHttpXPath::performRequest(std::string url) {
this->httpxpath.performRequest(url);
return true;
}
bool UHttpXPath::setHttpProxy(std::string url, long port) {
this->httpxpath.setHttpProxy(url, port);
return true;
}