From c34adc6e274c3dbb63af99ca566000e7d218244c Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Sun, 09 Dec 2007 17:22:06 +0000 Subject: reworked identity resolution and service discovery The discovery, which does both XRDS-based (Yadis, XRI, for XRI, using proxy) and HTML-based search, now returns results in opkele:idiscovery_t structure. It uses expat-based parser idigger_t, which itself is not exposed via any header files, but hidden in lib/discovery.cc, the discovery testing program is renamed from openid_resolve to idiscover. Signed-off-by: Michael Krelin --- (limited to 'test/idiscover.cc') diff --git a/test/idiscover.cc b/test/idiscover.cc new file mode 100644 index 0000000..2abedc9 --- a/dev/null +++ b/test/idiscover.cc @@ -0,0 +1,49 @@ +#include +#include +#include +#include +using namespace std; +#include +#include + +template + ostream& operator<<(ostream& o,const opkele::xrd::priority_map<_PDT>& pm) { + for(typename opkele::xrd::priority_map<_PDT>::const_iterator i=pm.begin(); + i!=pm.end();++i) + o << ' ' << i->second << '[' << i->first << ']'; + return o; + } + +ostream& operator<<(ostream& o,const opkele::xrd::service_t s) { + o << "{" << endl + << " Type: "; + copy(s.types.begin(),s.types.end(), + ostream_iterator(o," ")); + o << endl + << " URI: " << s.uris << endl + << " LocalID: " << s.local_ids << endl; + o << "}"; +} + +int main(int argc,char **argv) { + try { + if(argc<2) + throw opkele::exception(OPKELE_CP_ "Please, give me something to resolve"); + for(int a=1;a