| 45 | } |
| 46 | |
| 47 | bool vtkTextCodec::IsValid(istream& InputStream) |
| 48 | { |
| 49 | bool returnBool = true; |
| 50 | // get the position of the stream so we can restore it when we are done |
| 51 | istream::pos_type StreamPos = InputStream.tellg(); |
| 52 | |
| 53 | try |
| 54 | { |
| 55 | bucketIterator bucket; |
| 56 | this->ToUnicode(InputStream, bucket); |
| 57 | } |
| 58 | catch (...) |
| 59 | { |
| 60 | returnBool = false; |
| 61 | } |
| 62 | |
| 63 | // reset the stream |
| 64 | InputStream.clear(); |
| 65 | InputStream.seekg(StreamPos); |
| 66 | |
| 67 | return returnBool; |
| 68 | } |
| 69 | |
| 70 | void vtkTextCodec::ToUnicode(istream& inputStream, vtkTextCodec::OutputIterator& output) |
| 71 | { |