X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=libctsim%2Farray2dfile.cpp;h=49f90f45182c30c656ee2bdb17162cce4e01a059;hb=4076fbc077adfd9ee610beef09b52d9e12c14abb;hp=c450a0ec8389751a44187e32dd8b1c625181718c;hpb=9b2bb510160bdb56f04847f5b55ab61dd8a47976;p=ctsim.git diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index c450a0e..49f90f4 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.24 2001/01/02 05:34:57 kevin Exp $ +** $Id: array2dfile.cpp,v 1.26 2001/01/02 07:47:36 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 @@ -168,6 +168,21 @@ Array2dFileLabel::printBrief (std::ostream& os) const os << "Unknown (" << getDateString() << "): " << m_strLabel << std::endl; } } + +void +Array2dFileLabel::printBrief (std::ostringstream& os) const +{ + if (m_labelType == L_HISTORY) { + os << "History ("; + if (m_calcTime > 0) + os << m_calcTime << " secs, "; + os << getDateString().c_str() << "): " << m_strLabel.c_str() << "\n"; + } else if (m_labelType == L_USER) { + os << "Note (" << getDateString() << "): " << m_strLabel << "\n"; + } else { + os << "Unknown (" << getDateString() << "): " << m_strLabel << "\n"; + } +} /////////////////////////////////////////////////////////////////////////// @@ -646,7 +661,7 @@ Array2dFile::labelAdd (const Array2dFileLabel& label) } void -Array2dFile::labelsCopy (Array2dFile& copyFile, const char* const pszId) +Array2dFile::labelsCopy (const Array2dFile& copyFile, const char* const pszId) { std::string id; if (pszId) @@ -696,6 +711,16 @@ Array2dFile::printLabelsBrief (std::ostream& os) const } } +void +Array2dFile::printLabelsBrief (std::ostringstream& 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