dumpValue methods

This commit is contained in:
Matej Sekoranja
2012-08-21 23:34:59 +02:00
parent 978cb937c4
commit 4b26e1c442
2 changed files with 59 additions and 0 deletions
+13
View File
@@ -193,6 +193,19 @@ void PVField::toString(StringBuilder buf,int indentLevel)
if(pvAuxInfo.get()!=NULL) pvAuxInfo->toString(buf,indentLevel);
}
std::ostream& PVField::dumpValue(std::ostream& o) const
{
// default implementation
// each PVField class should implement it to avoid switch statement
// and string reallocation
static ConvertPtr convert = getConvert();
String tmp;
convert->getString(&tmp,this,0);
return o << tmp;
}
std::ostream& operator<<(std::ostream& o, const PVField& f) { return f.dumpValue(o); };
void PVField::computeOffset(const PVField * pvField) {
const PVStructure * pvTop = pvField->getParent();
if(pvTop==NULL) {