VTK
vtkTextCodec.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkTextCodec.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 vtkTextCodec_h
38 #define vtkTextCodec_h
39 
40 #include "vtkIOCoreModule.h" // For export macro
41 #include "vtkObject.h"
42 #include "vtkUnicodeString.h" // for the value type and for function return.
43 
44 class VTKIOCORE_EXPORT vtkTextCodec : public vtkObject
45 {
46 public:
47  vtkTypeMacro(vtkTextCodec, vtkObject);
48 
50 
54  virtual const char* Name();
55  void PrintSelf(ostream& os, vtkIndent indent);
57 
58  virtual bool CanHandle(const char* NameString);
59 
63  virtual bool IsValid(istream& InputStream);
64 
66 
73  {
74  public:
75  virtual OutputIterator& operator++(int) = 0;
76  virtual OutputIterator& operator*() = 0;
79 
80  OutputIterator() {} virtual ~OutputIterator() {}
81 
82  private:
83  OutputIterator(const OutputIterator&) VTK_DELETE_FUNCTION;
84  const OutputIterator& operator=(const OutputIterator&) VTK_DELETE_FUNCTION;
85  };
86 
92  virtual void ToUnicode(istream& InputStream,
93  vtkTextCodec::OutputIterator& output) = 0;
94 
99  vtkUnicodeString ToUnicode(istream & inputStream);
100 
106  virtual vtkUnicodeString::value_type NextUnicode(istream& inputStream) = 0;
107 
108 protected:
111 
112 private:
113  vtkTextCodec(const vtkTextCodec &) VTK_DELETE_FUNCTION;
114  void operator=(const vtkTextCodec &) VTK_DELETE_FUNCTION;
115 
116 };
117 
118 #endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
a base class that any output iterators need to derive from to use the first signature of to_unicode.
Definition: vtkTextCodec.h:73
virtual OutputIterator & operator++(int)=0
virtual OutputIterator & operator=(const vtkUnicodeString::value_type value)=0
virtual OutputIterator & operator*()=0
Virtual class to act as an interface for all text codecs.
Definition: vtkTextCodec.h:45
vtkUnicodeString ToUnicode(istream &inputStream)
convinience method to take data from the stream and put it into a vtkUnicodeString.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual vtkUnicodeString::value_type NextUnicode(istream &inputStream)=0
Return the next code point from the sequence represented by the stream advancing the stream through h...
virtual bool CanHandle(const char *NameString)
virtual void ToUnicode(istream &InputStream, vtkTextCodec::OutputIterator &output)=0
Iterate through the sequence represented by the stream assigning the result to the output iterator.
virtual bool IsValid(istream &InputStream)
is the given sample valid for this codec? The stream will not be advanced.
virtual const char * Name()
The name this codec goes by - should match the string the factory will take to create it.
String class that stores Unicode text.
vtkUnicodeStringValueType value_type
@ value
Definition: vtkX3D.h:220