VTK  9.2.5
vtkTextCodec.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: Visualization Toolkit
4Module: vtkTextCodec.h
5
6Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7All rights reserved.
8See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10This software is distributed WITHOUT ANY WARRANTY; without even
11the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
37#ifndef vtkTextCodec_h
38#define vtkTextCodec_h
39
40#include "vtkIOCoreModule.h" // For export macro
41#include "vtkObject.h"
42
43class VTKIOCORE_EXPORT vtkTextCodec : public vtkObject
44{
45public:
46 vtkTypeMacro(vtkTextCodec, vtkObject);
47
49
53 virtual const char* Name();
54 void PrintSelf(ostream& os, vtkIndent indent) override;
56
57 virtual bool CanHandle(const char* NameString);
58
62 virtual bool IsValid(istream& InputStream);
63
65
72 {
73 public:
74 virtual OutputIterator& operator++(int) { return *this; }
75 virtual OutputIterator& operator*() { return *this; }
76 virtual OutputIterator& operator=(const vtkTypeUInt32& value) = 0;
77
78 OutputIterator() = default;
79 virtual ~OutputIterator() = default;
80
81 private:
82 OutputIterator(const OutputIterator&) = delete;
83 OutputIterator& operator=(const OutputIterator&) = delete;
84 };
86
92 virtual void ToUnicode(istream& inputStream, vtkTextCodec::OutputIterator& output);
93
98 std::string ToString(istream& inputStream);
99
105 virtual vtkTypeUInt32 NextUTF32CodePoint(istream& inputStream) = 0;
106
107protected:
109 ~vtkTextCodec() override;
110
111private:
112 vtkTextCodec(const vtkTextCodec&) = delete;
113 void operator=(const vtkTextCodec&) = delete;
114};
115
116#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:63
a base class that any output iterators need to derive from to use the first signature of to_unicode.
Definition: vtkTextCodec.h:72
virtual OutputIterator & operator=(const vtkTypeUInt32 &value)=0
virtual OutputIterator & operator++(int)
Definition: vtkTextCodec.h:74
virtual ~OutputIterator()=default
virtual OutputIterator & operator*()
Definition: vtkTextCodec.h:75
Virtual class to act as an interface for all text codecs.
Definition: vtkTextCodec.h:44
virtual vtkTypeUInt32 NextUTF32CodePoint(istream &inputStream)=0
Return the next code point from the sequence represented by the stream advancing the stream through h...
virtual const char * Name()
The name this codec goes by - should match the string the factory will take to create it.
std::string ToString(istream &inputStream)
Convenience method to take data from the stream and put it into a string.
virtual bool CanHandle(const char *NameString)
~vtkTextCodec() override
void PrintSelf(ostream &os, vtkIndent indent) override
The name this codec goes by - should match the string the factory will take to create it.
virtual bool IsValid(istream &InputStream)
is the given sample valid for this codec? The stream will not be advanced.
virtual void ToUnicode(istream &inputStream, vtkTextCodec::OutputIterator &output)
Iterate through the sequence represented by the stream assigning the result to the output iterator.