MCFilePOTInfo.cxx File Reference

#include "DataUtil/MCFilePOTInfo.h"
#include "MessageService/MsgService.h"
#include "DatabaseInterface/DbiOutRowStream.h"
#include "DatabaseInterface/DbiResultSet.h"
#include "DatabaseInterface/DbiValidityRec.h"
#include <cmath>
#include <float.h>
#include "DatabaseInterface/DbiResultPtr.tpl"
#include "DatabaseInterface/DbiWriter.tpl"

Go to the source code of this file.

Namespaces

namespace  MCFilePOTInfoHelper

Functions

bool MCFilePOTInfoHelper::AreDoublesSame (double a, double b)
std::string MCFilePOTInfoHelper::trim (const std::string &str, const std::string &whitespace=" \t")
 CVSID ("$Id: MCFilePOTInfo.cxx,v 1.3 2013/09/25 18:11:05 rhatcher Exp $\n \ CVSID_DBIRESULTPTR ")
std::istream & operator>> (std::istream &is, MCFilePOTInfoKey &key)
std::ostream & operator<< (std::ostream &os, const MCFilePOTInfoKey &key)
std::istream & operator>> (std::istream &is, MCFilePOTInfo &row)
std::ostream & operator<< (std::ostream &os, const MCFilePOTInfo &row)

Function Documentation

CVSID ( "$Id: MCFilePOTInfo.  cxx,
v 1.3 2013/09/25 18:11:05 rhatcher Exp $\n\CVSID_DBIRESULTPTR"   
)
std::ostream& operator<< ( std::ostream &  os,
const MCFilePOTInfo row 
)

Definition at line 110 of file MCFilePOTInfo.cxx.

References MCFilePOTInfo::fAggNo, MCFilePOTInfo::fBar, MCFilePOTInfo::fComment, MCFilePOTInfo::fFoo, and MCFilePOTInfo::fKey.

00110                                                                  {
00111   // output operator (i.e. write object to stream)
00112   os << "MCFilePOTInfo: "
00113      << " AggNo " << std::setw(4) << row.fAggNo << " "
00114      << row.fKey << " Values: "
00115      << " " << row.fFoo << " " << row.fBar
00116      << " \"" << row.fComment << "\"";
00117     // << std::endl;  // assume user will supply newline when they print
00118     ;
00119   return os;
00120 }

std::ostream& operator<< ( std::ostream &  os,
const MCFilePOTInfoKey key 
)

Definition at line 78 of file MCFilePOTInfo.cxx.

References MCFilePOTInfoKey::fBlah, and MCFilePOTInfoKey::fVersion.

00078                                                                     {
00079   // output operator (i.e. write object to stream)
00080   os << "Key: "
00081      << key.fBlah << " " << key.fVersion
00082     // << std::endl;  // assume user will supply newline when they print
00083     ;
00084   return os;
00085 }

std::istream& operator>> ( std::istream &  is,
MCFilePOTInfo row 
)

Definition at line 87 of file MCFilePOTInfo.cxx.

References MCFilePOTInfo::fBar, MCFilePOTInfo::fComment, MCFilePOTInfo::fFoo, MCFilePOTInfo::fKey, len, and MCFilePOTInfoHelper::trim().

00087                                                            {
00088   // input operator (i.e. read from stream into object)
00089   is >>  row.fKey >> row.fFoo >> row.fBar;
00090   // get the rest of the line as the comment (function in #include <string>)
00091   std::getline(is,row.fComment);
00092 
00093   // trim lead/trailing spaces off comment (before remove " or ')
00094   row.fComment = trim(row.fComment);
00095   // erase enclosing "" or '' (only if they match)
00096   size_t len = row.fComment.size();
00097   char char0 = row.fComment[0];
00098   char charN = row.fComment[len-1];
00099   if ( ( char0 == '"'  && charN == '"'  ) ||
00100        ( char0 == '\'' && charN == '\'' )    ) {
00101     row.fComment.erase(len-1,1);
00102     row.fComment.erase(0,1);
00103   }
00104   // trim lead/trailing spaces off comment (after remove " or ')
00105   row.fComment = trim(row.fComment);
00106 
00107   return is;
00108 }

std::istream& operator>> ( std::istream &  is,
MCFilePOTInfoKey key 
)

Definition at line 72 of file MCFilePOTInfo.cxx.

00072                                                               {
00073   // input operator (i.e. read from stream into object)
00074   is >> key.fBlah >> key.fVersion;
00075   return is;
00076 }


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1