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);
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{};
A base class that contains common methods used for parsing csv files.
void PrintSelf(std::ostream &os, Indent indent) const override
void GetDataDimension(SizeValueType &rows, SizeValueType &cols)
TData ConvertStringToValueType(const std::string str)
~CSVFileReaderBase() override=default
void GetNextField(std::string &)
Control indentation during Print() invocation.
Light weight base class for most itk classes.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType