00001 /* -*- c++ -*- */ 00002 #ifndef AKAXISO2_FRAMEWORK_ANY_H__ 00003 #define AKAXISO2_FRAMEWORK_ANY_H__ 00004 00010 #include <akaxiso2/framework/qname.h> 00011 #include <akaxiso2/framework/document.h> 00012 #include <akaxiso2/util/shared_ptr.h> 00013 #include <vector> 00014 00015 namespace aka2 { 00016 00023 struct wc_attribute { 00024 wc_attribute(){} 00025 wc_attribute(const qname &name, const std::string &value) 00026 : name_(name), value_(value) {} 00028 qname name_; 00030 std::string value_; 00031 }; 00032 00037 typedef std::vector<wc_attribute> wc_attributes; 00038 00049 struct wildcard { 00051 qname name_; 00053 wc_attributes attributes_; 00055 std::string value_; 00057 std::vector<wildcard> children_; 00058 bool empty() const { return value_.empty() && attributes_.empty() && children_.empty(); } 00059 }; 00060 00061 struct any { 00062 wildcard wc_; 00063 document document_; 00064 bool empty() const { return (document_.empty() == 0) && wc_.empty(); } 00065 bool has_document() const { return !document_.empty(); } 00066 }; 00067 00072 typedef std::vector<wildcard> wc_array; 00073 typedef std::vector<any> any_array; 00074 } 00075 00076 bool operator==(const aka2::wildcard &lhs, const aka2::wildcard &rhs); 00077 00078 #endif