VTK  9.0.3
vtkUTF16TextCodec.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkUTF16TextCodec.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 =========================================================================*/
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 vtkUTF16TextCodec_h
38 #define vtkUTF16TextCodec_h
39 
40 #include "vtkIOCoreModule.h" // For export macro
41 #include "vtkTextCodec.h"
42 
43 class VTKIOCORE_EXPORT vtkUTF16TextCodec : public vtkTextCodec
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
54  const char* Name() override;
55  bool CanHandle(const char* NameString) override;
57 
61  void SetBigEndian(bool);
62 
66  void FindEndianness(istream& InputStream);
67 
71  bool IsValid(istream& InputStream) override;
72 
77  void ToUnicode(istream& InputStream, vtkTextCodec::OutputIterator& output) override;
78 
83  vtkUnicodeString::value_type NextUnicode(istream& inputStream) override;
84 
85 protected:
87  ~vtkUTF16TextCodec() override;
88 
90  bool _bigEndian;
91 
92 private:
93  vtkUTF16TextCodec(const vtkUTF16TextCodec&) = delete;
94  void operator=(const vtkUTF16TextCodec&) = delete;
95 };
96 
97 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
a base class that any output iterators need to derive from to use the first signature of to_unicode.
Definition: vtkTextCodec.h:73
Virtual class to act as an interface for all text codecs.
Definition: vtkTextCodec.h:45
Class to read/write ascii text.
void ToUnicode(istream &InputStream, vtkTextCodec::OutputIterator &output) override
Iterate through the sequence represented by the begin and end iterators assigning the result to the o...
void SetBigEndian(bool)
Set the endianness - true if Big false is little.
static vtkUTF16TextCodec * New()
vtkUnicodeString::value_type NextUnicode(istream &inputStream) override
Return the next code point from the sequence represented by the begin, end iterators advancing begin ...
const char * Name() override
The name this codec goes by - should match the string the factory will take to create it.
~vtkUTF16TextCodec() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool CanHandle(const char *NameString) override
void FindEndianness(istream &InputStream)
Set the endianness - true if Big false is little.
bool IsValid(istream &InputStream) override
is the given sample valid for this codec? - will take endianness into account
vtkUnicodeStringValueType value_type