VTK
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#include "vtkUnicodeString.h" // for the value type and for function return.
43
44class VTKIOCORE_EXPORT vtkTextCodec : public vtkObject
45{
46public:
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
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,
94
99 vtkUnicodeString ToUnicode(istream & inputStream);
100
106 virtual vtkUnicodeString::value_type NextUnicode(istream& inputStream) = 0;
107
108protected:
111
112private:
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=(const vtkUnicodeString::value_type value)=0
virtual OutputIterator & operator++(int)=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.
virtual const char * Name()
The name this codec goes by - should match the string the factory will take to create it.
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.
String class that stores Unicode text.
vtkUnicodeStringValueType value_type
@ value
Definition: vtkX3D.h:220