inline LPCSTR getName(IPropertyTree * parent, bool forceQualified = false) const { if(type != TLT_attribute && parent && (ShowQualifiedNames || forceQualified)) { static StringBuffer buf; buf.clear().append(type == TLT_attribute ? name + 1 : pTree->queryName()); buf.append("["); buf.append(parent->queryChildIndex(pTree) + 1); buf.append("]"); return buf.toCharArray(); } return type == TLT_attribute ? name + 1 : pTree->queryName(); }
bool CLogThread::FlattenArray(IArrayOf<IEspLogInfo>& valueArray,IPropertyTree& tree,StringBuffer& RootName) { StringBuffer Value,Name; if (tree.hasChildren() == true) { Name.appendf("%s",tree.queryName()); Owned<IPropertyTreeIterator> itrItem = tree.getElements("./*"); itrItem->first(); while(itrItem->isValid()==true) { IPropertyTree &node = itrItem->query(); if(Value.length()!=0) Value.append(","); Value.appendf("%s",node.queryProp("")); itrItem->next(); } IClientLogInfo& logElement = addLogInfoElement(valueArray); logElement.setName(Name.str()); logElement.setValue(Value.str()); } return true; }