VTK  9.2.5
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 
46 #ifndef vtkDelimitedTextWriter_h
47 #define vtkDelimitedTextWriter_h
48 
49 #include "vtkIOCoreModule.h" // For export macro
50 #include "vtkWriter.h"
51 
52 class vtkStdString;
53 class vtkTable;
54 
55 class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
56 {
57 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
66  vtkSetStringMacro(FieldDelimiter);
67  vtkGetStringMacro(FieldDelimiter);
69 
71 
75  vtkSetStringMacro(StringDelimiter);
76  vtkGetStringMacro(StringDelimiter);
78 
80 
86 
88 
92  vtkSetMacro(UseStringDelimiter, bool);
93  vtkGetMacro(UseStringDelimiter, bool);
95 
97 
100  vtkSetMacro(WriteToOutputString, bool);
101  vtkGetMacro(WriteToOutputString, bool);
102  vtkBooleanMacro(WriteToOutputString, bool);
104 
110 
116 
117 protected:
120 
123 
124  bool OpenStream();
125 
126  void WriteData() override;
127  virtual void WriteTable(vtkTable* table);
128 
129  // see algorithm for more info.
130  // This writer takes in vtkTable.
132 
133  char* FileName;
137 
138  ostream* Stream;
139 
140 private:
142  void operator=(const vtkDelimitedTextWriter&) = delete;
143 };
144 
145 #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:119
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:108
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:183
abstract class to write data to file(s)
Definition: vtkWriter.h:46
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453