50#ifndef vtkDelimitedTextReader_h
51#define vtkDelimitedTextReader_h
53#include "vtkIOInfovisModule.h"
60VTK_ABI_NAMESPACE_BEGIN
87 vtkGetStringMacro(InputString);
89 vtkGetMacro(InputStringLength,
int);
92 this->SetInputString(input.c_str(),
static_cast<int>(input.length()));
118 vtkGetStringMacro(UnicodeCharacterSet);
119 vtkSetStringMacro(UnicodeCharacterSet);
140 vtkSetStringMacro(FieldDelimiterCharacters);
141 vtkGetStringMacro(FieldDelimiterCharacters);
157 vtkGetMacro(StringDelimiter,
char);
158 vtkSetMacro(StringDelimiter,
char);
168 vtkSetMacro(UseStringDelimiter,
bool);
169 vtkGetMacro(UseStringDelimiter,
bool);
170 vtkBooleanMacro(UseStringDelimiter,
bool);
178 vtkGetMacro(HaveHeaders,
bool);
179 vtkSetMacro(HaveHeaders,
bool);
188 vtkSetMacro(MergeConsecutiveDelimiters,
bool);
189 vtkGetMacro(MergeConsecutiveDelimiters,
bool);
190 vtkBooleanMacro(MergeConsecutiveDelimiters,
bool);
222 vtkSetMacro(DetectNumericColumns,
bool);
223 vtkGetMacro(DetectNumericColumns,
bool);
224 vtkBooleanMacro(DetectNumericColumns,
bool);
233 vtkSetMacro(ForceDouble,
bool);
234 vtkGetMacro(ForceDouble,
bool);
235 vtkBooleanMacro(ForceDouble,
bool);
254 vtkSetMacro(TrimWhitespacePriorToNumericConversion,
bool);
255 vtkGetMacro(TrimWhitespacePriorToNumericConversion,
bool);
256 vtkBooleanMacro(TrimWhitespacePriorToNumericConversion,
bool);
264 vtkSetMacro(DefaultIntegerValue,
int);
265 vtkGetMacro(DefaultIntegerValue,
int);
273 vtkSetMacro(DefaultDoubleValue,
double);
274 vtkGetMacro(DefaultDoubleValue,
double);
282 vtkSetStringMacro(PedigreeIdArrayName);
283 vtkGetStringMacro(PedigreeIdArrayName);
291 vtkSetMacro(GeneratePedigreeIds,
bool);
292 vtkGetMacro(GeneratePedigreeIds,
bool);
293 vtkBooleanMacro(GeneratePedigreeIds,
bool);
300 vtkSetMacro(OutputPedigreeIds,
bool);
301 vtkGetMacro(OutputPedigreeIds,
bool);
302 vtkBooleanMacro(OutputPedigreeIds,
bool);
311 vtkSetMacro(AddTabFieldDelimiter,
bool);
312 vtkGetMacro(AddTabFieldDelimiter,
bool);
313 vtkBooleanMacro(AddTabFieldDelimiter,
bool);
329 vtkSetMacro(ReplacementCharacter, vtkTypeUInt32);
330 vtkGetMacro(ReplacementCharacter, vtkTypeUInt32);
339 vtkGetMacro(Preview, std::string);
357 vtkGetMacro(CommentCharacters, std::string);
358 vtkSetMacro(CommentCharacters, std::string);
371 char* FileName =
nullptr;
373 char* InputString =
nullptr;
374 int InputStringLength = 0;
375 char* UnicodeCharacterSet =
nullptr;
378 std::string UnicodeRecordDelimiters =
"\r\n";
379 std::string UnicodeFieldDelimiters =
",";
380 std::string UnicodeStringDelimiters =
"\"";
381 std::string UnicodeWhitespace =
" \t\r\n\v\f";
382 std::string UnicodeEscapeCharacter =
"\\";
383 std::string CommentCharacters =
"#";
384 bool DetectNumericColumns =
false;
385 bool ForceDouble =
false;
386 bool TrimWhitespacePriorToNumericConversion =
false;
387 int DefaultIntegerValue = 0;
388 double DefaultDoubleValue = 0.;
389 char* FieldDelimiterCharacters =
nullptr;
390 char StringDelimiter =
'"';
391 bool UseStringDelimiter =
true;
392 bool HaveHeaders =
false;
393 bool MergeConsecutiveDelimiters =
false;
394 char* PedigreeIdArrayName =
nullptr;
395 bool GeneratePedigreeIds =
true;
396 bool OutputPedigreeIds =
false;
397 bool AddTabFieldDelimiter =
false;
399 vtkTypeUInt32 ReplacementCharacter =
'x';
409 std::unique_ptr<std::istream> OpenStream();
415 void ReadBOM(std::istream* stream);
421 vtkTextCodec* CreateTextCodec(std::istream* input_stream);
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
void SetInputString(const char *in, int len)
Specify the InputString for use when reading from a character array.
int ReadData(vtkTable *output_table)
~vtkDelimitedTextReader() override
void SetUTF8RecordDelimiters(const char *delimiters)
Specify the character(s) that will be used to separate records.
vtkStdString GetLastError()
Returns a human-readable description of the most recent error, if any.
void SetInputString(const char *in)
Specify the InputString for use when reading from a character array.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetUTF8StringDelimiters(const char *delimiters)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGetFilePathMacro(FileName)
Specifies the delimited text file to be loaded.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
const char * GetUTF8StringDelimiters()
vtkSetFilePathMacro(FileName)
Specifies the delimited text file to be loaded.
static vtkDelimitedTextReader * New()
const char * GetUTF8RecordDelimiters()
Specify the character(s) that will be used to separate records.
void SetInputString(const vtkStdString &input)
Specify the InputString for use when reading from a character array.
const char * GetUTF8FieldDelimiters()
void SetUTF8FieldDelimiters(const char *delimiters)
a simple class to control print indentation
Wrapper around std::string to keep symbols short.
Superclass for algorithms that produce only vtkTables as output.
A table, which contains similar-typed columns of data.
Virtual class to act as an interface for all text codecs.