VTK  9.3.0
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
10#ifndef vtkDelimitedTextWriter_h
11#define vtkDelimitedTextWriter_h
12
13#include "vtkIOCoreModule.h" // For export macro
14#include "vtkWriter.h"
15
16VTK_ABI_NAMESPACE_BEGIN
17class vtkStdString;
18class vtkTable;
19
20class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
21{
22public:
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
28
31 vtkSetStringMacro(FieldDelimiter);
32 vtkGetStringMacro(FieldDelimiter);
34
36
40 vtkSetStringMacro(StringDelimiter);
41 vtkGetStringMacro(StringDelimiter);
43
45
51
53
57 vtkSetMacro(UseStringDelimiter, bool);
58 vtkGetMacro(UseStringDelimiter, bool);
60
62
65 vtkSetMacro(WriteToOutputString, bool);
66 vtkGetMacro(WriteToOutputString, bool);
67 vtkBooleanMacro(WriteToOutputString, bool);
69
75
81
82protected:
85
88
89 bool OpenStream();
90
91 void WriteData() override;
92 virtual void WriteTable(vtkTable* table);
93
94 // see algorithm for more info.
95 // This writer takes in vtkTable.
96 int FillInputPortInformation(int port, vtkInformation* info) override;
97
98 char* FileName;
102
103 ostream* Stream;
104
105private:
107 void operator=(const vtkDelimitedTextWriter&) = delete;
108};
109
110VTK_ABI_NAMESPACE_END
111#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:29
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:59
abstract class to write data to file(s)
Definition vtkWriter.h:32