VTK  9.4.20241218
vtkDelimitedTextWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
29#ifndef vtkDelimitedTextWriter_h
30#define vtkDelimitedTextWriter_h
31
32#include "vtkIOCoreModule.h" // For export macro
33#include "vtkWriter.h"
34
35VTK_ABI_NAMESPACE_BEGIN
36class vtkStdString;
37class vtkTable;
38
39class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
47
50 vtkSetStringMacro(FieldDelimiter);
51 vtkGetStringMacro(FieldDelimiter);
53
55
59 vtkSetStringMacro(StringDelimiter);
60 vtkGetStringMacro(StringDelimiter);
62
64
70
72
76 vtkSetMacro(UseStringDelimiter, bool);
77 vtkGetMacro(UseStringDelimiter, bool);
79
81
84 vtkSetMacro(WriteToOutputString, bool);
85 vtkGetMacro(WriteToOutputString, bool);
86 vtkBooleanMacro(WriteToOutputString, bool);
88
94
100
101protected:
104
107
109
110 void WriteData() override;
111 virtual void WriteTable(vtkTable* table);
112
113 // see algorithm for more info.
114 // This writer takes in vtkTable.
115 int FillInputPortInformation(int port, vtkInformation* info) override;
116
117 char* FileName;
121
122 ostream* Stream;
123
124private:
126 void operator=(const vtkDelimitedTextWriter&) = delete;
127};
128
129VTK_ABI_NAMESPACE_END
130#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.
vtkSetFilePathMacro(FileName)
Get/Set the filename for the file.
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to nullptr, so that the user is responsible...
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169
abstract class to write data to file(s)
Definition vtkWriter.h:35