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);
125 void GetNextField(std::string & );
134 template <
class TData>
135 TData ConvertStringToValueType(
const std::string str)
138 std::istringstream isstream(str);
142 size_t isstreamtellg =
static_cast<size_t>(isstream.tellg() );
144 if (!isstream.fail() || isstreamtellg == str.length() )
150 return vcl_numeric_limits<TData>::quiet_NaN();
159 virtual void Parse()=0;
175 void PrintSelf(std::ostream & os,
Indent indent)
const;
178 void PrepareForParsing();
182 void operator=(
const Self &);