ZMap_Any operator*(const ZNameVal& iNV0, const ZNameVal& iNV1) { ZMap_Any result; result.Set(iNV0); result.Set(iNV1); return result; }
ZRef<ZYadR> YadSeqR::ReadInc() { vector<string8> theValues; if (!spReadValues(theValues, fDivider_Value, fDivider_Line, fStrimmerR->GetStrimR())) return null; ZMap_Any theMap; for (size_t x = 0; x < fNames.size() && x < theValues.size(); ++x) theMap.Set(fNames[x], theValues[x]); return sYadR(theMap); }
ZMap_Any sAugmented(const ZMap_Any& iUnder, const ZMap_Any& iOver) { ZMap_Any result = iUnder; for (ZMap_Any::Index_t ii = iOver.Begin(); ii != iOver.End(); ++ii) { const ZMap_Any::Name_t& theName = iOver.NameOf(ii); const ZVal_Any& theOverVal = iOver.Get(ii); if (ZVal_Any* theResultVal = result.PMut(theName)) { // Already have a val in result if (const ZMap_Any* theOverMap = theOverVal.PGet<ZMap_Any>()) { // Over is a map if (ZMap_Any* theResultMap = theResultVal->PMut<ZMap_Any>()) { // And result is a map, so we augment, and continue so as to skip // the default replacement operation below. *theResultMap *= *theOverMap; continue; } } // If we don't have two maps, replace existing result with over's. *theResultVal = theOverVal; } else { // No existing val in result, just shove in over's. result.Set(theName, theOverVal); } } return result; }
ZMap_Any::Index_t ZMap_Any::IndexOf(const ZMap_Any& iOther, const Index_t& iOtherIndex) const { if (this == &iOther) return iOtherIndex; return this->IndexOf(iOther.NameOf(iOtherIndex)); }
int sCompare_T(const ZMap_Any& iL, const ZMap_Any& iR) { return iL.Compare(iR); }