// $Revision: 1.3 $ // Copyright (c) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_STREAMEXAMPLE #define TaligentSamples_STREAMEXAMPLE #ifndef Taligent_TEXT #include #endif #ifndef SAMPLE_NEWVERSION // Illustrate streaming and version compatibility. This is the old version. // You may compile it by changing the flag in the .PinkMake file and // rebuilding the project. class TStreamExample { public: TaligentTypeExtensionDeclarationsMacro(TStreamExample) enum EEnum { kOne, kTwo }; TStreamExample(int, EEnum, const TText&); TStreamExample(const TStreamExample&); virtual ~TStreamExample(); TStreamExample& operator=(const TStreamExample&); virtual TStream& operator>>=(TStream&) const; virtual TStream& operator<<=(TStream&); const TText* GetText() const; protected: TStreamExample(); private: int fInt; EEnum fEnum; TText* fText; TText* fCache; enum EVersion { kOriginalVersion }; }; #else // This is the new version. It removes the enum from the old version, and adds a // TGlobalID. It is backwards compatible with the old version. #ifndef Taligent_GLOBALID #include #endif class TStreamExample { public: TaligentTypeExtensionDeclarationsMacro(TStreamExample) TStreamExample(int, const TText&); TStreamExample(const TStreamExample&); virtual ~TStreamExample(); TStreamExample& operator=(const TStreamExample&); virtual TStream& operator>>=(TStream&) const; virtual TStream& operator<<=(TStream&); const TText* GetText() const; protected: TStreamExample(); private: enum EEnum { kOne, kTwo }; int fInt; TGlobalID fID; TText* fText; TText* fCache; enum EVersion { kOriginalVersion, kVersion2 }; }; #endif // SAMPLE_NEWVERSION #endif // TaligentSamples_STREAMEXAMPLE