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 
69 #ifndef __vtkDelimitedTextReader_h
70 #define __vtkDelimitedTextReader_h
71 
72 #include "vtkIOInfovisModule.h" // For export macro
73 #include "vtkTableAlgorithm.h"
74 #include "vtkUnicodeString.h" // Needed for vtkUnicodeString
75 #include "vtkStdString.h" // Needed for vtkStdString
76 
78 {
79 public:
80  static vtkDelimitedTextReader* New();
82  void PrintSelf(ostream& os, vtkIndent indent);
83 
85 
86  vtkGetStringMacro(FileName);
87  vtkSetStringMacro(FileName);
89 
91 
95  void SetInputString(const char *in);
96  vtkGetStringMacro(InputString);
97  void SetInputString(const char *in, int len);
98  vtkGetMacro(InputStringLength, int);
100  { this->SetInputString(input.c_str(), static_cast<int>(input.length())); }
102 
104 
106  vtkSetMacro(ReadFromInputString,int);
107  vtkGetMacro(ReadFromInputString,int);
108  vtkBooleanMacro(ReadFromInputString,int);
110 
112 
120  vtkGetStringMacro(UnicodeCharacterSet);
121  vtkSetStringMacro(UnicodeCharacterSet);
123 
125 
128  void SetUTF8RecordDelimiters(const char* delimiters);
129  const char* GetUTF8RecordDelimiters();
130  void SetUnicodeRecordDelimiters(const vtkUnicodeString& delimiters);
131  vtkUnicodeString GetUnicodeRecordDelimiters();
133 
135 
140  vtkSetStringMacro(FieldDelimiterCharacters);
141  vtkGetStringMacro(FieldDelimiterCharacters);
143 
144  void SetUTF8FieldDelimiters(const char* delimiters);
145  const char* GetUTF8FieldDelimiters();
146  void SetUnicodeFieldDelimiters(const vtkUnicodeString& delimiters);
147  vtkUnicodeString GetUnicodeFieldDelimiters();
148 
150 
155  vtkGetMacro(StringDelimiter, char);
156  vtkSetMacro(StringDelimiter, char);
158 
159  void SetUTF8StringDelimiters(const char* delimiters);
160  const char* GetUTF8StringDelimiters();
161  void SetUnicodeStringDelimiters(const vtkUnicodeString& delimiters);
162  vtkUnicodeString GetUnicodeStringDelimiters();
163 
165 
166  vtkSetMacro(UseStringDelimiter, bool);
167  vtkGetMacro(UseStringDelimiter, bool);
168  vtkBooleanMacro(UseStringDelimiter, bool);
170 
172 
173  vtkGetMacro(HaveHeaders, bool);
174  vtkSetMacro(HaveHeaders, bool);
176 
178 
181  vtkSetMacro(MergeConsecutiveDelimiters, bool);
182  vtkGetMacro(MergeConsecutiveDelimiters, bool);
183  vtkBooleanMacro(MergeConsecutiveDelimiters, bool);
185 
187 
190  vtkGetMacro(MaxRecords, vtkIdType);
191  vtkSetMacro(MaxRecords, vtkIdType);
193 
195 
198  vtkSetMacro(DetectNumericColumns, bool);
199  vtkGetMacro(DetectNumericColumns, bool);
200  vtkBooleanMacro(DetectNumericColumns, bool);
202 
204 
207  vtkSetMacro(ForceDouble, bool);
208  vtkGetMacro(ForceDouble, bool);
209  vtkBooleanMacro(ForceDouble, bool);
211 
213 
222  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
223  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
224  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
226 
228 
231  vtkSetMacro(DefaultIntegerValue, int);
232  vtkGetMacro(DefaultIntegerValue, int);
234 
236 
239  vtkSetMacro(DefaultDoubleValue, double);
240  vtkGetMacro(DefaultDoubleValue, double);
242 
244 
246  vtkSetStringMacro(PedigreeIdArrayName);
247  vtkGetStringMacro(PedigreeIdArrayName);
249 
251 
253  vtkSetMacro(GeneratePedigreeIds, bool);
254  vtkGetMacro(GeneratePedigreeIds, bool);
255  vtkBooleanMacro(GeneratePedigreeIds, bool);
257 
259 
260  vtkSetMacro(OutputPedigreeIds, bool);
261  vtkGetMacro(OutputPedigreeIds, bool);
262  vtkBooleanMacro(OutputPedigreeIds, bool);
264 
268  vtkStdString GetLastError();
269 
271 
274  vtkSetMacro(ReplacementCharacter, vtkTypeUInt32);
275  vtkGetMacro(ReplacementCharacter, vtkTypeUInt32);
277 
278 //BTX
279 protected:
282 
283  int RequestData(
287 
288  char* FileName;
290  char *InputString;
314  vtkTypeUInt32 ReplacementCharacter;
315 
316 private:
317  vtkDelimitedTextReader(const vtkDelimitedTextReader&); // Not implemented
318  void operator=(const vtkDelimitedTextReader&); // Not implemented
319 //ETX
320 };
321 
322 #endif
323 
void SetInputString(const vtkStdString &input)
vtkUnicodeString UnicodeRecordDelimiters
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
void PrintSelf(ostream &os, vtkIndent indent)
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkUnicodeString UnicodeStringDelimiters
#define VTKIOINFOVIS_EXPORT
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
GLenum GLsizei len
Definition: vtkgl.h:13010
GLuint in
Definition: vtkgl.h:16905
int vtkIdType
Definition: vtkType.h:268
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:94
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
a simple class to control print indentation
Definition: vtkIndent.h:38
#define vtkGetStringMacro(name)
Definition: vtkSetGet.h:120
vtkUnicodeString UnicodeEscapeCharacter
vtkUnicodeString UnicodeWhitespace
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkUnicodeString UnicodeFieldDelimiters
Superclass for algorithms that produce only vtkTables as output.
Store zero or more vtkInformation instances.
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
String class that stores Unicode text.
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69