VTK
vtkDelimitedTextReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDelimitedTextReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
21 
64 #ifndef vtkDelimitedTextReader_h
65 #define vtkDelimitedTextReader_h
66 
67 #include "vtkIOInfovisModule.h" // For export macro
68 #include "vtkTableAlgorithm.h"
69 #include "vtkUnicodeString.h" // Needed for vtkUnicodeString
70 #include "vtkStdString.h" // Needed for vtkStdString
71 
72 class VTKIOINFOVIS_EXPORT vtkDelimitedTextReader : public vtkTableAlgorithm
73 {
74 public:
75  static vtkDelimitedTextReader* New();
77  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
78 
80 
83  vtkGetStringMacro(FileName);
84  vtkSetStringMacro(FileName);
86 
88 
94  void SetInputString(const char *in);
95  vtkGetStringMacro(InputString);
96  void SetInputString(const char *in, int len);
97  vtkGetMacro(InputStringLength, int);
98  void SetInputString(const vtkStdString& input)
99  { this->SetInputString(input.c_str(), static_cast<int>(input.length())); }
101 
103 
107  vtkSetMacro(ReadFromInputString,int);
108  vtkGetMacro(ReadFromInputString,int);
109  vtkBooleanMacro(ReadFromInputString,int);
111 
113 
124  vtkGetStringMacro(UnicodeCharacterSet);
125  vtkSetStringMacro(UnicodeCharacterSet);
127 
129 
134  void SetUTF8RecordDelimiters(const char* delimiters);
135  const char* GetUTF8RecordDelimiters();
136  void SetUnicodeRecordDelimiters(const vtkUnicodeString& delimiters);
137  vtkUnicodeString GetUnicodeRecordDelimiters();
139 
141 
148  vtkSetStringMacro(FieldDelimiterCharacters);
149  vtkGetStringMacro(FieldDelimiterCharacters);
151 
152  void SetUTF8FieldDelimiters(const char* delimiters);
153  const char* GetUTF8FieldDelimiters();
154  void SetUnicodeFieldDelimiters(const vtkUnicodeString& delimiters);
155  vtkUnicodeString GetUnicodeFieldDelimiters();
156 
158 
167  vtkGetMacro(StringDelimiter, char);
168  vtkSetMacro(StringDelimiter, char);
170 
171  void SetUTF8StringDelimiters(const char* delimiters);
172  const char* GetUTF8StringDelimiters();
173  void SetUnicodeStringDelimiters(const vtkUnicodeString& delimiters);
174  vtkUnicodeString GetUnicodeStringDelimiters();
175 
177 
180  vtkSetMacro(UseStringDelimiter, bool);
181  vtkGetMacro(UseStringDelimiter, bool);
182  vtkBooleanMacro(UseStringDelimiter, bool);
184 
186 
190  vtkGetMacro(HaveHeaders, bool);
191  vtkSetMacro(HaveHeaders, bool);
193 
195 
200  vtkSetMacro(MergeConsecutiveDelimiters, bool);
201  vtkGetMacro(MergeConsecutiveDelimiters, bool);
202  vtkBooleanMacro(MergeConsecutiveDelimiters, bool);
204 
206 
210  vtkGetMacro(MaxRecords, vtkIdType);
211  vtkSetMacro(MaxRecords, vtkIdType);
213 
215 
220  vtkSetMacro(DetectNumericColumns, bool);
221  vtkGetMacro(DetectNumericColumns, bool);
222  vtkBooleanMacro(DetectNumericColumns, bool);
224 
226 
231  vtkSetMacro(ForceDouble, bool);
232  vtkGetMacro(ForceDouble, bool);
233  vtkBooleanMacro(ForceDouble, bool);
235 
237 
252  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
253  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
254  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
256 
258 
262  vtkSetMacro(DefaultIntegerValue, int);
263  vtkGetMacro(DefaultIntegerValue, int);
265 
267 
271  vtkSetMacro(DefaultDoubleValue, double);
272  vtkGetMacro(DefaultDoubleValue, double);
274 
276 
280  vtkSetStringMacro(PedigreeIdArrayName);
281  vtkGetStringMacro(PedigreeIdArrayName);
283 
285 
289  vtkSetMacro(GeneratePedigreeIds, bool);
290  vtkGetMacro(GeneratePedigreeIds, bool);
291  vtkBooleanMacro(GeneratePedigreeIds, bool);
293 
295 
298  vtkSetMacro(OutputPedigreeIds, bool);
299  vtkGetMacro(OutputPedigreeIds, bool);
300  vtkBooleanMacro(OutputPedigreeIds, bool);
302 
308  vtkStdString GetLastError();
309 
311 
316  vtkSetMacro(ReplacementCharacter, vtkTypeUInt32);
317  vtkGetMacro(ReplacementCharacter, vtkTypeUInt32);
319 
320 protected:
322  ~vtkDelimitedTextReader() VTK_OVERRIDE;
323 
324  int RequestData(
327  vtkInformationVector*) VTK_OVERRIDE;
328 
329  char* FileName;
331  char *InputString;
355  vtkTypeUInt32 ReplacementCharacter;
356 
357 private:
358  vtkDelimitedTextReader(const vtkDelimitedTextReader&) VTK_DELETE_FUNCTION;
359  void operator=(const vtkDelimitedTextReader&) VTK_DELETE_FUNCTION;
360 
361 };
362 
363 #endif
364 
void SetInputString(const vtkStdString &input)
Specify the InputString for use when reading from a character array.
vtkUnicodeString UnicodeRecordDelimiters
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:41
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
vtkUnicodeString UnicodeStringDelimiters
int vtkIdType
Definition: vtkType.h:345
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkUnicodeString UnicodeEscapeCharacter
vtkUnicodeString UnicodeWhitespace
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkUnicodeString UnicodeFieldDelimiters
Superclass for algorithms that produce only vtkTables as output.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
String class that stores Unicode text.