VTK
dox/IO/vtkTextCodec.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   Visualization Toolkit
00004 Module:    vtkTextCodec.h
00005 
00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007 All rights reserved.
00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010 This software is distributed WITHOUT ANY WARRANTY; without even
00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012 PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00036 #ifndef __vtkTextCodec_h
00037 #define __vtkTextCodec_h
00038 
00039 #include "vtkObject.h"
00040 #include "vtkUnicodeString.h" // for the value type and for function return.
00041 
00042 class VTK_IO_EXPORT vtkTextCodec : public vtkObject
00043 {
00044 public:
00045   vtkTypeMacro(vtkTextCodec, vtkObject);
00046 
00048 
00050   virtual const char* Name();
00051   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00054   virtual bool CanHandle(const char* NameString);
00055 
00058   virtual bool IsValid(istream& InputStream);
00059 
00061 
00065   class OutputIterator
00066   {
00067   public:
00068     virtual OutputIterator& operator++(int) = 0;
00069     virtual OutputIterator& operator*() = 0;
00070     virtual OutputIterator& operator=(const vtkUnicodeString::value_type value) = 0;
00072 
00073     OutputIterator() {}    virtual ~OutputIterator() {}
00074 
00075   private:
00076     OutputIterator(const OutputIterator&); // Not implemented
00077     const OutputIterator& operator=(const OutputIterator&); // Not Implemented
00078   };
00079 
00081 
00084   virtual void ToUnicode(istream& InputStream,
00085                          vtkTextCodec::OutputIterator& output) = 0;
00087 
00090   vtkUnicodeString ToUnicode(istream & inputStream);
00091 
00095   virtual vtkUnicodeString::value_type NextUnicode(istream& inputStream) = 0;
00096 
00097 //BTX
00098 protected:
00099   vtkTextCodec();
00100   ~vtkTextCodec();
00101 
00102 private:
00103   vtkTextCodec(const vtkTextCodec &); // Not implemented.
00104   void operator=(const vtkTextCodec &); // Not implemented.
00105 
00106 //ETX
00107 };
00108 
00109 #endif