summaryrefslogtreecommitdiffabout
path: root/include/opkele/discovery.h
blob: af4aa29152587930b16ca5d77de5b244313b5118 (plain)
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
37
38
39
40
#ifndef __OPKELE_DISCOVERY_H
#define __OPKELE_DISCOVERY_H

#include <string>
#include <opkele/types.h>

namespace opkele {
    using std::string;

    struct idiscovery_t;

    void idiscover(idiscovery_t& result,const string& identity);

    struct idiscovery_t {
	bool xri_identity;
	string normalized_id;
	string canonicalized_id;
	xrd::XRD_t xrd;

	idiscovery_t() { }
	idiscovery_t(const string& i) {
	    idiscover(*this,i);
	}
	idiscovery_t(const char *i) {
	    idiscover(*this,i);
	}

	void clear() {
	    normalized_id.clear(); canonicalized_id.clear();
	    xrd.clear();
	}

	idiscovery_t& operator=(const string& i) {
	    idiscover(*this,i); return *this; }
	idiscovery_t& operator=(const char *i) {
	    idiscover(*this,i); return *this; }
    };
}

#endif /* __OPKELE_DISCOVERY_H */