VTK  9.3.20240328
vtkArchiver.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
18 #ifndef vtkArchiver_h
19 #define vtkArchiver_h
20 
21 #include "vtkCommonCoreModule.h" // For export macro
22 
23 #include "vtkObject.h"
24 
25 #include <ios> // For std::streamsize
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class VTKCOMMONCORE_EXPORT vtkArchiver : public vtkObject
29 {
30 public:
31  static vtkArchiver* New();
32  vtkTypeMacro(vtkArchiver, vtkObject);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
39  vtkGetStringMacro(ArchiveName);
40  vtkSetStringMacro(ArchiveName);
42 
44 
47  virtual void OpenArchive();
49 
51 
54  virtual void CloseArchive();
56 
58 
61  virtual void InsertIntoArchive(
62  const std::string& relativePath, const char* data, std::size_t size);
64 
66 
69  virtual bool Contains(const std::string& relativePath);
71 
72 protected:
74  ~vtkArchiver() override;
75 
76  char* ArchiveName;
77 
78 private:
79  vtkArchiver(const vtkArchiver&) = delete;
80  void operator=(const vtkArchiver&) = delete;
81 };
82 
83 VTK_ABI_NAMESPACE_END
84 #endif
Writes an archive.
Definition: vtkArchiver.h:29
virtual void InsertIntoArchive(const std::string &relativePath, const char *data, std::size_t size)
Insert data of size size into the archive at relativePath.
virtual void CloseArchive()
Close the archive.
~vtkArchiver() override
static vtkArchiver * New()
virtual void OpenArchive()
Open the archive for writing.
char * ArchiveName
Definition: vtkArchiver.h:76
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool Contains(const std::string &relativePath)
Checks if relativePath represents an entry in the archive.
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
@ size
Definition: vtkX3D.h:253
@ data
Definition: vtkX3D.h:315
@ string
Definition: vtkX3D.h:490