19 #ifndef itkCSVFileReaderBase_h
20 #define itkCSVFileReaderBase_h
27 #include "ITKIOCSVExport.h"
80 itkSetStringMacro(FileName);
85 itkSetMacro(FieldDelimiterCharacter,
char);
88 itkGetMacro(FieldDelimiterCharacter,
char);
92 itkSetMacro(UseStringDelimiterCharacter,
bool);
95 itkGetConstMacro(UseStringDelimiterCharacter,
bool);
98 itkSetMacro(StringDelimiterCharacter,
char);
101 itkGetMacro(StringDelimiterCharacter,
char);
105 itkSetMacro(HasRowHeaders,
bool);
108 itkGetConstMacro(HasRowHeaders,
bool);
112 itkSetMacro(HasColumnHeaders,
bool);
115 itkGetConstMacro(HasColumnHeaders,
bool);
120 itkBooleanMacro(HasRowHeaders);
121 itkBooleanMacro(HasColumnHeaders);
122 itkBooleanMacro(UseStringDelimiterCharacter);
133 GetNextField(std::string &);
142 template <
typename TData>
147 std::istringstream isstream(str);
150 if ((isstream >> value).fail() || !(isstream >> std::ws).eof())
152 return std::numeric_limits<TData>::quiet_NaN();
169 std::string m_FileName{};
170 char m_FieldDelimiterCharacter{};
171 char m_StringDelimiterCharacter{};
172 bool m_UseStringDelimiterCharacter{};
173 bool m_HasRowHeaders{};
174 bool m_HasColumnHeaders{};
175 std::ifstream m_InputStream{};
176 int m_EndOfColumnHeadersLine{};
177 std::string m_Line{};
183 PrintSelf(std::ostream & os,
Indent indent)
const override;