VTK  9.3.1
vtkBufferedArchiver.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
17 #ifndef vtkBufferedArchiver_h
18 #define vtkBufferedArchiver_h
19 
20 #include "vtkCommonArchiveModule.h" // For export macro
21 
22 #include "vtkArchiver.h"
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class VTKCOMMONARCHIVE_EXPORT vtkBufferedArchiver : public vtkArchiver
26 {
27 public:
28  static vtkBufferedArchiver* New();
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
33 
36  void OpenArchive() override;
38 
40 
43  void CloseArchive() override;
45 
47 
50  void InsertIntoArchive(
51  const std::string& relativePath, const char* data, std::size_t size) override;
53 
55 
58  bool Contains(const std::string& relativePath) override;
60 
62 
65  const char* GetBuffer();
67 
69 
72  const void* GetBufferAddress();
74 
76 
79  void SetAllocatedSize(std::size_t);
80  std::size_t GetAllocatedSize();
82 
84 
87  std::size_t GetBufferSize();
89 
90 protected:
92  ~vtkBufferedArchiver() override;
93 
94  struct Internal;
95  Internal* Internals;
96 
97 private:
99  void operator=(const vtkBufferedArchiver&) = delete;
100 };
101 
102 VTK_ABI_NAMESPACE_END
103 #endif
virtual void CloseArchive()
Close the archive.
Writes an archive to a buffer for vtk-js datasets.
a simple class to control print indentation
Definition: vtkIndent.h:28
Writes an archive.
Definition: vtkArchiver.h:28
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.
virtual void OpenArchive()
Open the archive for writing.
static vtkArchiver * New()
virtual void InsertIntoArchive(const std::string &relativePath, const char *data, std::size_t size)
Insert data of size size into the archive at relativePath.