+bool ParamInfo::ParamData::operator==(ParamInfo::ParamData const & rhs) const
+{
+ return name() == rhs.name() && isOptional() == rhs.isOptional();
+}
+
+
+bool ParamInfo::hasParam(std::string const & name) const
+{
+ const_iterator it = begin();
+ for (; it != end(); ++it) {
+ if (it->name() == name)
+ return true;
+ }
+ return false;
+}
+
+
+void ParamInfo::add(std::string const & name, bool opt)
+{
+ info_.push_back(ParamData(name, opt));
+}
+
+
+bool ParamInfo::operator==(ParamInfo const & rhs) const
+{
+ // the idea here is to check each ParamData for equality
+ const_iterator itL = begin();
+ const_iterator itR = rhs.begin();
+ const_iterator endL = end();
+ const_iterator endR = rhs.end();
+ while (true) {
+ // if they both end together, return true
+ if (itL == endL && itR == endR)
+ return true;
+ // but if one ends before the other, return false
+ if (itL == endL || itR == endR)
+ return false;
+ //check this one for equality
+ if (*itL != *itR)
+ return false;
+ // equal, so check the next one
+ ++itL;
+ ++itR;
+ }
+}
+