X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Farray2dfile.cpp;h=c450a0ec8389751a44187e32dd8b1c625181718c;hp=d0f2d6859051a7fc72c82e065f6560e50dc14345;hb=9b2bb510160bdb56f04847f5b55ab61dd8a47976;hpb=9f7d379c2b03f3c09907cfd885072433e0428042 diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index d0f2d68..c450a0e 100644 --- a/libctsim/array2dfile.cpp +++ b/libctsim/array2dfile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.cpp,v 1.23 2001/01/01 10:14:34 kevin Exp $ +** $Id: array2dfile.cpp,v 1.24 2001/01/02 05:34:57 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -137,23 +137,38 @@ Array2dFileLabel::operator= (const Array2dFileLabel& rhs) return (*this); } -void -Array2dFileLabel::print (std::ostream& os) const -{ - if (m_labelType == L_HISTORY) { - os << "History: " << std::endl; - os << " " << m_strLabel << std::endl; - os << " calc time = " << m_calcTime << " secs" << std::endl; - os << " Timestamp = " << getDateString() << std::endl; - } else if (m_labelType == L_USER) { - os << "Note: " << m_strLabel << std::endl; - os << " Timestamp = %s" << getDateString() << std::endl; - } else { - os << "Unknown (" << m_labelType << "): " << m_strLabel << std::endl; - os << " Timestamp = %s" << getDateString() << std::endl; - } -} - +void +Array2dFileLabel::print (std::ostream& os) const +{ + if (m_labelType == L_HISTORY) { + os << "History: " << std::endl; + os << " " << m_strLabel << std::endl; + os << " calc time = " << m_calcTime << " secs" << std::endl; + os << " Timestamp = " << getDateString() << std::endl; + } else if (m_labelType == L_USER) { + os << "Note: " << m_strLabel << std::endl; + os << " Timestamp = %s" << getDateString() << std::endl; + } else { + os << "Unknown (" << m_labelType << "): " << m_strLabel << std::endl; + os << " Timestamp = %s" << getDateString() << std::endl; + } +} + +void +Array2dFileLabel::printBrief (std::ostream& os) const +{ + if (m_labelType == L_HISTORY) { + os << "History ("; + if (m_calcTime > 0) + os << m_calcTime << " secs, "; + os << getDateString() << "): " << m_strLabel << std::endl; + } else if (m_labelType == L_USER) { + os << "Note (" << getDateString() << "): " << m_strLabel << std::endl; + } else { + os << "Unknown (" << getDateString() << "): " << m_strLabel << std::endl; + } +} + /////////////////////////////////////////////////////////////////////////// // CLASS IMPLEMENTATION @@ -660,17 +675,27 @@ Array2dFile::arrayDataClear (void) } } -void -Array2dFile::printLabels (std::ostream& os) const -{ - for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) { - const Array2dFileLabel& label = **l; - - label.print (os); - os << std::endl; - } -} - +void +Array2dFile::printLabels (std::ostream& os) const +{ + for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) { + const Array2dFileLabel& label = **l; + + label.print (os); + os << std::endl; + } +} + +void +Array2dFile::printLabelsBrief (std::ostream& os) const +{ + for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) { + const Array2dFileLabel& label = **l; + + label.printBrief (os); + } +} + const Array2dFileLabel& Array2dFile::labelGet (int i) const