summaryrefslogtreecommitdiffabout
path: root/include/opkele/discovery.h
Side-by-side diff
Diffstat (limited to 'include/opkele/discovery.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/discovery.h40
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 @@
+#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 */