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 
70 #ifndef vtkDelimitedTextReader_h
71 #define vtkDelimitedTextReader_h
72 
73 #include "vtkIOInfovisModule.h" // For export macro
74 #include "vtkTableAlgorithm.h"
75 #include "vtkUnicodeString.h" // Needed for vtkUnicodeString
76 #include "vtkStdString.h" // Needed for vtkStdString
77 
78 class VTKIOINFOVIS_EXPORT vtkDelimitedTextReader : public vtkTableAlgorithm
79 {
80 public:
83  void PrintSelf(ostream& os, vtkIndent indent);
84 
86 
89  vtkGetStringMacro(FileName);
90  vtkSetStringMacro(FileName);
92 
94 
100  void SetInputString(const char *in);
101  vtkGetStringMacro(InputString);
102  void SetInputString(const char *in, int len);
103  vtkGetMacro(InputStringLength, int);
104  void SetInputString(const vtkStdString& input)
105  { this->SetInputString(input.c_str(), static_cast<int>(input.length())); }
107 
109 
113  vtkSetMacro(ReadFromInputString,int);
114  vtkGetMacro(ReadFromInputString,int);
115  vtkBooleanMacro(ReadFromInputString,int);
117 
119 
130  vtkGetStringMacro(UnicodeCharacterSet);
131  vtkSetStringMacro(UnicodeCharacterSet);
133 
135 
140  void SetUTF8RecordDelimiters(const char* delimiters);
141  const char* GetUTF8RecordDelimiters();
145 
147 
154  vtkSetStringMacro(FieldDelimiterCharacters);
155  vtkGetStringMacro(FieldDelimiterCharacters);
157 
158  void SetUTF8FieldDelimiters(const char* delimiters);
159  const char* GetUTF8FieldDelimiters();
162 
164 
173  vtkGetMacro(StringDelimiter, char);
174  vtkSetMacro(StringDelimiter, char);
176 
177  void SetUTF8StringDelimiters(const char* delimiters);
178  const char* GetUTF8StringDelimiters();
181 
183 
186  vtkSetMacro(UseStringDelimiter, bool);
187  vtkGetMacro(UseStringDelimiter, bool);
188  vtkBooleanMacro(UseStringDelimiter, bool);
190 
192 
196  vtkGetMacro(HaveHeaders, bool);
197  vtkSetMacro(HaveHeaders, bool);
199 
201 
206  vtkSetMacro(MergeConsecutiveDelimiters, bool);
207  vtkGetMacro(MergeConsecutiveDelimiters, bool);
208  vtkBooleanMacro(MergeConsecutiveDelimiters, bool);
210 
212 
216  vtkGetMacro(MaxRecords, vtkIdType);
217  vtkSetMacro(MaxRecords, vtkIdType);
219 
221 
226  vtkSetMacro(DetectNumericColumns, bool);
227  vtkGetMacro(DetectNumericColumns, bool);
228  vtkBooleanMacro(DetectNumericColumns, bool);
230 
232 
237  vtkSetMacro(ForceDouble, bool);
238  vtkGetMacro(ForceDouble, bool);
239  vtkBooleanMacro(ForceDouble, bool);
241 
243 
258  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
259  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
260  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
262 
264 
268  vtkSetMacro(DefaultIntegerValue, int);
269  vtkGetMacro(DefaultIntegerValue, int);
271 
273 
277  vtkSetMacro(DefaultDoubleValue, double);
278  vtkGetMacro(DefaultDoubleValue, double);
280 
282 
286  vtkSetStringMacro(PedigreeIdArrayName);
287  vtkGetStringMacro(PedigreeIdArrayName);
289 
291 
295  vtkSetMacro(GeneratePedigreeIds, bool);
296  vtkGetMacro(GeneratePedigreeIds, bool);
297  vtkBooleanMacro(GeneratePedigreeIds, bool);
299 
301 
304  vtkSetMacro(OutputPedigreeIds, bool);
305  vtkGetMacro(OutputPedigreeIds, bool);
306  vtkBooleanMacro(OutputPedigreeIds, bool);
308 
315 
317 
322  vtkSetMacro(ReplacementCharacter, vtkTypeUInt32);
323  vtkGetMacro(ReplacementCharacter, vtkTypeUInt32);
325 
326 protected:
329 
334 
335  char* FileName;
337  char *InputString;
361  vtkTypeUInt32 ReplacementCharacter;
362 
363 private:
364  vtkDelimitedTextReader(const vtkDelimitedTextReader&) VTK_DELETE_FUNCTION;
365  void operator=(const vtkDelimitedTextReader&) VTK_DELETE_FUNCTION;
366 
367 };
368 
369 #endif
370 
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
void SetInputString(const char *in, int len)
vtkUnicodeString GetUnicodeRecordDelimiters()
void SetUnicodeRecordDelimiters(const vtkUnicodeString &delimiters)
const char * GetUTF8StringDelimiters()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
static vtkDelimitedTextReader * New()
vtkUnicodeString UnicodeWhitespace
vtkUnicodeString UnicodeRecordDelimiters
vtkUnicodeString UnicodeFieldDelimiters
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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.
vtkUnicodeString UnicodeStringDelimiters
void SetInputString(const char *in)
Specify the InputString for use when reading from a character array.
void SetUTF8StringDelimiters(const char *delimiters)
void SetUnicodeFieldDelimiters(const vtkUnicodeString &delimiters)
vtkUnicodeString GetUnicodeStringDelimiters()
void SetUnicodeStringDelimiters(const vtkUnicodeString &delimiters)
vtkUnicodeString GetUnicodeFieldDelimiters()
vtkUnicodeString UnicodeEscapeCharacter
void SetInputString(const vtkStdString &input)
const char * GetUTF8FieldDelimiters()
void SetUTF8FieldDelimiters(const char *delimiters)
const char * GetUTF8RecordDelimiters()
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
Superclass for algorithms that produce only vtkTables as output.
String class that stores Unicode text.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
int vtkIdType
Definition: vtkType.h:287