VTK  9.3.1
vtkFileResourceStream.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
3 #ifndef vtkFileResourceStream_h
4 #define vtkFileResourceStream_h
5 
6 #include "vtkIOCoreModule.h" // For export macro
7 #include "vtkResourceStream.h"
8 
9 #include <memory> // for std::unique_ptr
10 
11 VTK_ABI_NAMESPACE_BEGIN
12 
16 class VTKIOCORE_EXPORT vtkFileResourceStream : public vtkResourceStream
17 {
18  struct vtkInternals;
19 
20 public:
22  static vtkFileResourceStream* New();
23  void PrintSelf(ostream& os, vtkIndent indent) override;
24 
37  bool Open(VTK_FILEPATH const char* path);
38 
40 
43  std::size_t Read(void* buffer, std::size_t bytes) override;
44  bool EndOfStream() override;
45  vtkTypeInt64 Seek(vtkTypeInt64 pos, SeekDirection dir) override;
46  vtkTypeInt64 Tell() override;
48 
49 protected:
51  ~vtkFileResourceStream() override;
54 
55 private:
56  std::unique_ptr<vtkInternals> Impl;
57 };
58 
59 VTK_ABI_NAMESPACE_END
60 
61 #endif
vtkResourceStream implementation for file input
Abstract class used for custom streams.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual vtkTypeInt64 Seek(vtkTypeInt64 pos, SeekDirection dir)
Move the stream cursor position.
virtual std::size_t Read(void *buffer, std::size_t bytes)=0
Read data form the stream.
virtual bool EndOfStream()=0
Check if the stream reached an end.
#define VTK_FILEPATH
vtkResourceStream & operator=(const vtkResourceStream &)=delete
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual vtkTypeInt64 Tell()
Get the stream cursor position.