VTK  9.2.20230331
vtkArchiver.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArchiver.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
30 #ifndef vtkArchiver_h
31 #define vtkArchiver_h
32 
33 #include "vtkCommonCoreModule.h" // For export macro
34 
35 #include "vtkObject.h"
36 
37 #include <ios> // For std::streamsize
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class VTKCOMMONCORE_EXPORT vtkArchiver : public vtkObject
41 {
42 public:
43  static vtkArchiver* New();
44  vtkTypeMacro(vtkArchiver, vtkObject);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
51  vtkGetStringMacro(ArchiveName);
52  vtkSetStringMacro(ArchiveName);
54 
56 
59  virtual void OpenArchive();
61 
63 
66  virtual void CloseArchive();
68 
70 
73  virtual void InsertIntoArchive(
74  const std::string& relativePath, const char* data, std::size_t size);
76 
78 
81  virtual bool Contains(const std::string& relativePath);
83 
84 protected:
86  ~vtkArchiver() override;
87 
88  char* ArchiveName;
89 
90 private:
91  vtkArchiver(const vtkArchiver&) = delete;
92  void operator=(const vtkArchiver&) = delete;
93 };
94 
95 VTK_ABI_NAMESPACE_END
96 #endif
Writes an archive.
Definition: vtkArchiver.h:41
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:88
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:120
abstract base class for most VTK objects
Definition: vtkObject.h:83
@ size
Definition: vtkX3D.h:265
@ data
Definition: vtkX3D.h:327
@ string
Definition: vtkX3D.h:502