-rw-r--r-- | include/opkele/discovery.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/opkele/discovery.h b/include/opkele/discovery.h new file mode 100644 index 0000000..af4aa29 --- a/dev/null +++ b/include/opkele/discovery.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef __OPKELE_DISCOVERY_H | ||
2 | #define __OPKELE_DISCOVERY_H | ||
3 | |||
4 | #include <string> | ||
5 | #include <opkele/types.h> | ||
6 | |||
7 | namespace opkele { | ||
8 | using std::string; | ||
9 | |||
10 | struct idiscovery_t; | ||
11 | |||
12 | void idiscover(idiscovery_t& result,const string& identity); | ||
13 | |||
14 | struct idiscovery_t { | ||
15 | bool xri_identity; | ||
16 | string normalized_id; | ||
17 | string canonicalized_id; | ||
18 | xrd::XRD_t xrd; | ||
19 | |||
20 | idiscovery_t() { } | ||
21 | idiscovery_t(const string& i) { | ||
22 | idiscover(*this,i); | ||
23 | } | ||
24 | idiscovery_t(const char *i) { | ||
25 | idiscover(*this,i); | ||
26 | } | ||
27 | |||
28 | void clear() { | ||
29 | normalized_id.clear(); canonicalized_id.clear(); | ||
30 | xrd.clear(); | ||
31 | } | ||
32 | |||
33 | idiscovery_t& operator=(const string& i) { | ||
34 | idiscover(*this,i); return *this; } | ||
35 | idiscovery_t& operator=(const char *i) { | ||
36 | idiscover(*this,i); return *this; } | ||
37 | }; | ||
38 | } | ||
39 | |||
40 | #endif /* __OPKELE_DISCOVERY_H */ | ||