VTK  9.3.20240416
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:
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:
54 
55 private:
56  std::unique_ptr<vtkInternals> Impl;
57 };
58 
59 VTK_ABI_NAMESPACE_END
60 
61 #endif
vtkResourceStream implementation for file input
vtkFileResourceStream & operator=(const vtkFileResourceStream &)=delete
vtkTypeInt64 Tell() override
Override vtkResourceStream functions.
bool EndOfStream() override
Override vtkResourceStream functions.
bool Open(VTK_FILEPATH const char *path)
Open a file.
vtkTypeInt64 Seek(vtkTypeInt64 pos, SeekDirection dir) override
Override vtkResourceStream functions.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkFileResourceStream(const vtkFileResourceStream &)=delete
std::size_t Read(void *buffer, std::size_t bytes) override
Override vtkResourceStream functions.
static vtkFileResourceStream * New()
~vtkFileResourceStream() override
a simple class to control print indentation
Definition: vtkIndent.h:108
Abstract class used for custom streams.
@ dir
Definition: vtkX3D.h:324
#define VTK_FILEPATH