VTK  9.2.6
vtkDelimitedTextWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkDelimitedTextWriter.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 2009 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 
36 #ifndef vtkDelimitedTextWriter_h
37 #define vtkDelimitedTextWriter_h
38 
39 #include "vtkIOCoreModule.h" // For export macro
40 #include "vtkWriter.h"
41 
42 class vtkStdString;
43 class vtkTable;
44 
45 class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
56  vtkSetStringMacro(FieldDelimiter);
57  vtkGetStringMacro(FieldDelimiter);
59 
61 
65  vtkSetStringMacro(StringDelimiter);
66  vtkGetStringMacro(StringDelimiter);
68 
70 
76 
78 
82  vtkSetMacro(UseStringDelimiter, bool);
83  vtkGetMacro(UseStringDelimiter, bool);
85 
87 
90  vtkSetMacro(WriteToOutputString, bool);
91  vtkGetMacro(WriteToOutputString, bool);
92  vtkBooleanMacro(WriteToOutputString, bool);
94 
100 
106 
107 protected:
110 
113 
114  bool OpenStream();
115 
116  void WriteData() override;
117  virtual void WriteTable(vtkTable* table);
118 
119  // see algorithm for more info.
120  // This writer takes in vtkTable.
122 
123  char* FileName;
127 
128  ostream* Stream;
129 
130 private:
132  void operator=(const vtkDelimitedTextWriter&) = delete;
133 };
134 
135 #endif
Delimited text writer for vtkTable Writes a vtkTable as a delimited text file (such as CSV).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void WriteTable(vtkTable *table)
void WriteData() override
vtkGetFilePathMacro(FileName)
Get/Set the filename for the file.
static vtkDelimitedTextWriter * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkDelimitedTextWriter() override
vtkStdString GetString(vtkStdString string)
Internal method: Returns the "string" with the "StringDelimiter" if UseStringDelimiter is true.
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to nullptr, so that the user is responsible...
vtkSetFilePathMacro(FileName)
Get/Set the filename for the file.
a simple class to control print indentation
Definition: vtkIndent.h:49
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:83
abstract class to write data to file(s)
Definition: vtkWriter.h:46
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453