LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Namespaces | Macros
Csv.cc File Reference

CSV I/O class implementations. More...

#include "lsst/ap/utils/Csv.h"
#include <cerrno>
#include <cfloat>
#include <cstring>
#include <sstream>
#include <utility>
#include "boost/filesystem.hpp"
#include "boost/regex.hpp"
#include "lsst/utils/ieee.h"
#include "lsst/pex/exceptions.h"

Go to the source code of this file.

Namespaces

 lsst
 Estimate image backgrounds.
 
 lsst::ap
 
 lsst::ap::utils
 

Macros

#define LSST_SPECIALIZE_GET(T, C, fun)
 
#define LSST_SPECIALIZE_GET(T, fun)
 
#define LSST_IMPLEMENT_APPEND_FIELD(T, C, fmt)
 

Detailed Description

CSV I/O class implementations.

Author
Serge Monkewitz

Definition in file Csv.cc.

Macro Definition Documentation

#define LSST_IMPLEMENT_APPEND_FIELD (   T,
  C,
  fmt 
)
Value:
void CsvWriter::appendField(T v) { \
char buf[64]; \
int n = snprintf(buf, sizeof(buf), fmt, static_cast<C>(v)); \
if (n <= 0) { \
throw LSST_EXCEPT(pexExcept::RuntimeError, \
"failed to convert " #T " to a string"); \
} else if (n >= static_cast<int>(sizeof(buf))) { \
throw LSST_EXCEPT(pexExcept::LogicError, \
"internal buffer for string conversion too small"); \
} \
_write(buf); \
}
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46

Definition at line 735 of file Csv.cc.

#define LSST_SPECIALIZE_GET (   T,
  C,
  fun 
)
Value:
template <> T CsvReader::_get<T>(char const *field) const { \
char *e; \
errno = 0; \
C v = fun(field, &e, 10); \
if (e == field) { \
_runtimeError("failed to convert field value to " #T); \
} else if ((errno == ERANGE) || \
_runtimeError("field value overflow during conversion to " #T); \
} \
_checkWhitespace(e, "failed to convert field value to " #T); \
return v; \
}
double min
Definition: attributes.cc:216
double max
Definition: attributes.cc:218

Definition at line 627 of file Csv.cc.

#define LSST_SPECIALIZE_GET (   T,
  fun 
)
Value:
template <> T CsvReader::_get<T>(char const *field) const { \
char *e; \
errno = 0; \
T v = fun(field, &e); \
if (e == field) { \
_runtimeError("failed to convert field value to " #T); \
} \
_checkWhitespace(e, "failed to convert field value to " #T); \
return v; \
}

Definition at line 627 of file Csv.cc.