#include <LineEndConvertor.h>
Inheritance diagram for Core::LineEndConvertor:
Public Member Functions | |
LineEndConvertor (LineEndConvention convention, Stream *stream) | |
virtual Object * | next (void) |
virtual SequenceableCollection * | next (long items) |
virtual SequenceableCollection * | next (long items, SequenceableCollection *newColl, long index) |
virtual void | nextPut (Object *object) |
virtual void | nextPut (const char object) |
virtual bool | isBinary (void) |
virtual void | setLineEndCharacter (void) |
Static Public Member Functions | |
static LineEndConvertor * | lineEndCROn (Stream *stream) |
static LineEndConvertor * | lineEndLFOn (Stream *stream) |
static LineEndConvertor * | lineEndCRLFOn (Stream *stream) |
Protected Member Functions | |
virtual SequenceableCollection * | contentSpeciesFor (long items) |
Protected Attributes | |
Character * | line_end_character |
LineEndConvention | line_end_convention |
|
Definition at line 8 of file LineEndConvertor.cc. References line_end_convention, and setLineEndCharacter(). Referenced by lineEndCRLFOn(), lineEndCROn(), and lineEndLFOn(). 00009 : StreamDecorator(stream) 00010 { 00011 line_end_convention = convention; 00012 setLineEndCharacter(); 00013 }
|
|
Reimplemented from Core::StreamDecorator. Definition at line 81 of file LineEndConvertor.cc. 00082 { 00083 return new String(items); 00084 }
|
|
Reimplemented from Core::Stream. Definition at line 67 of file LineEndConvertor.cc. 00068 { 00069 return false; 00070 }
|
|
Definition at line 26 of file LineEndConvertor.cc. References LineEndConvertor(), and Core::LineEndCRLF. 00027 { 00028 return new LineEndConvertor(LineEndCRLF, stream); 00029 }
|
|
Definition at line 16 of file LineEndConvertor.cc. References LineEndConvertor(), and Core::LineEndCR. 00017 { 00018 return new LineEndConvertor(LineEndCR, stream); 00019 }
|
|
Definition at line 21 of file LineEndConvertor.cc. References LineEndConvertor(), and Core::LineEndLF. 00022 { 00023 return new LineEndConvertor(LineEndLF, stream); 00024 }
|
|
Reimplemented from Core::Stream. Definition at line 30 of file LineEndConvertor.h. References Core::Stream::next(). 00031 { return StreamDecorator::next(items, newColl, index); }
|
|
Reimplemented from Core::Stream. Definition at line 28 of file LineEndConvertor.h. References Core::Stream::next(). 00029 { return StreamDecorator::next(items); }
|
|
Reimplemented from Core::Stream. Definition at line 32 of file LineEndConvertor.cc. References Core::Character::isEqual(), Core::Character::lf(), line_end_character, line_end_convention, Core::LineEndCR, Core::LineEndCRLF, Core::Stream::next(), nil, Core::Stream::skip(), and Core::StreamDecorator::underlying_stream. 00033 { 00034 Character *ch = dynamic_cast<Character *>(underlying_stream->next()); 00035 if (line_end_character == nil || !line_end_character->isEqual(ch)) 00036 return ch; 00037 if (line_end_convention == LineEndCR) return Character::lf(); 00038 if (line_end_convention == LineEndCRLF) { 00039 ch = dynamic_cast<Character *>(underlying_stream->next()); 00040 if (ch == nil) return Character::lf(); 00041 if (!ch->isEqual(Character::lf())) underlying_stream->skip(-1); 00042 } 00043 return Character::lf(); 00044 }
|
|
Reimplemented from Core::Stream. Definition at line 33 of file LineEndConvertor.h. References Core::Stream::nextPut(). 00034 { StreamDecorator::nextPut(object); }
|
|
Reimplemented from Core::Stream. Definition at line 46 of file LineEndConvertor.cc. References Core::Character::cr(), Core::Object::isEqual(), Core::Character::lf(), line_end_convention, Core::LineEndCR, Core::LineEndCRLF, Core::LineEndLF, Core::LineEndTransparent, Core::Stream::nextPut(), and Core::StreamDecorator::underlying_stream. 00047 { 00048 if (object->isEqual(Character::lf())) { 00049 switch (line_end_convention) { 00050 case LineEndCR : 00051 underlying_stream->nextPut(Character::cr()); 00052 break; 00053 case LineEndCRLF : 00054 underlying_stream->nextPut(Character::cr()); 00055 underlying_stream->nextPut(object); 00056 break; 00057 case LineEndLF : 00058 case LineEndTransparent : 00059 underlying_stream->nextPut(object); 00060 break; 00061 } 00062 } else 00063 underlying_stream->nextPut(object); 00064 }
|
|
Definition at line 73 of file LineEndConvertor.cc. References Core::Character::cr(), line_end_character, line_end_convention, Core::LineEndCR, Core::LineEndCRLF, and nil. Referenced by LineEndConvertor(). 00074 { 00075 line_end_character = nil; 00076 if (line_end_convention == LineEndCRLF || 00077 line_end_convention == LineEndCR) 00078 line_end_character = Character::cr(); 00079 }
|
|
Definition at line 15 of file LineEndConvertor.h. Referenced by next(), and setLineEndCharacter(). |
|
Definition at line 16 of file LineEndConvertor.h. Referenced by LineEndConvertor(), next(), nextPut(), and setLineEndCharacter(). |