19 #ifndef __itkCSVFileReaderBase_h
20 #define __itkCSVFileReaderBase_h
23 #include <vcl_limits.h>
74 itkSetStringMacro(FileName);
79 itkSetMacro(FieldDelimiterCharacter,
char);
82 itkGetMacro(FieldDelimiterCharacter,
char);
86 itkSetMacro(UseStringDelimiterCharacter,
bool);
89 itkGetConstMacro(UseStringDelimiterCharacter,
bool);
92 itkSetMacro(StringDelimiterCharacter,
char);
95 itkGetMacro(StringDelimiterCharacter,
char);
99 itkSetMacro(HasRowHeaders,
bool);
102 itkGetConstMacro(HasRowHeaders,
bool);
106 itkSetMacro(HasColumnHeaders,
bool);
109 itkGetConstMacro(HasColumnHeaders,
bool);
114 itkBooleanMacro(HasRowHeaders);
115 itkBooleanMacro(HasColumnHeaders);
116 itkBooleanMacro(UseStringDelimiterCharacter);
134 template <
typename TData>
138 std::istringstream isstream(str);
141 if ((isstream >> value).fail() || !(isstream >> std::ws).eof())
143 return std::numeric_limits<TData>::quiet_NaN();
156 virtual void Parse()=0;
172 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Light weight base class for most itk classes.
void operator=(const Self &)
char m_FieldDelimiterCharacter
unsigned long SizeValueType
void GetDataDimension(SizeValueType &rows, SizeValueType &columns)
void GetNextField(std::string &)
char m_StringDelimiterCharacter
LightProcessObject Superclass
virtual ~CSVFileReaderBase()
std::ifstream m_InputStream
bool m_UseStringDelimiterCharacter
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Control indentation during Print() invocation.
A base class that contains common methods used for parsing csv files.
TData ConvertStringToValueType(const std::string str)
Base class for most ITK classes.
int m_EndOfColumnHeadersLine