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);
99  void SetInputString(const vtkStdString& input)
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 
174  vtkGetMacro(HaveHeaders, bool);
175  vtkSetMacro(HaveHeaders, bool);
177 
179 
182  vtkSetMacro(MergeConsecutiveDelimiters, bool);
183  vtkGetMacro(MergeConsecutiveDelimiters, bool);
184  vtkBooleanMacro(MergeConsecutiveDelimiters, bool);
186 
188 
191  vtkGetMacro(MaxRecords, vtkIdType);
192  vtkSetMacro(MaxRecords, vtkIdType);
194 
196 
199  vtkSetMacro(DetectNumericColumns, bool);
200  vtkGetMacro(DetectNumericColumns, bool);
201  vtkBooleanMacro(DetectNumericColumns, bool);
203 
205 
208  vtkSetMacro(ForceDouble, bool);
209  vtkGetMacro(ForceDouble, bool);
210  vtkBooleanMacro(ForceDouble, bool);
212 
214 
223  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
224  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
225  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
227 
229 
232  vtkSetMacro(DefaultIntegerValue, int);
233  vtkGetMacro(DefaultIntegerValue, int);
235 
237 
240  vtkSetMacro(DefaultDoubleValue, double);
241  vtkGetMacro(DefaultDoubleValue, double);
243 
245 
247  vtkSetStringMacro(PedigreeIdArrayName);
248  vtkGetStringMacro(PedigreeIdArrayName);
250 
252 
254  vtkSetMacro(GeneratePedigreeIds, bool);
255  vtkGetMacro(GeneratePedigreeIds, bool);
256  vtkBooleanMacro(GeneratePedigreeIds, bool);
258 
260 
261  vtkSetMacro(OutputPedigreeIds, bool);
262  vtkGetMacro(OutputPedigreeIds, bool);
263  vtkBooleanMacro(OutputPedigreeIds, bool);
265 
269  vtkStdString GetLastError();
270 
272 
275  vtkSetMacro(ReplacementCharacter, vtkTypeUInt32);
276  vtkGetMacro(ReplacementCharacter, vtkTypeUInt32);
278 
279 //BTX
280 protected:
283 
284  int RequestData(
288 
289  char* FileName;
291  char *InputString;
315  vtkTypeUInt32 ReplacementCharacter;
316 
317 private:
318  vtkDelimitedTextReader(const vtkDelimitedTextReader&); // Not implemented
319  void operator=(const vtkDelimitedTextReader&); // Not implemented
320 //ETX
321 };
322 
323 #endif
324 
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.
vtkUnicodeString UnicodeStringDelimiters
#define VTKIOINFOVIS_EXPORT
int vtkIdType
Definition: vtkType.h:247
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
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.
String class that stores Unicode text.