Public Types | |
| enum | { kStreamKeyWord_List = '****', kStreamKeyWord_Default = '@@@@' } |
Public Member Functions | |
| TMCStreamBased () | |
| virtual void | InitOnNew () |
| virtual void | TopLevelRead (TMCiostream &stream) |
| virtual void | Read (TMCiostream &stream) |
| virtual void | ReadAttribute (int32 keyword, TMCiostream &stream) |
| virtual void | ReadListAttribute (int32 keyword, TMCiostream &stream, TMCPtrArray< void > *list) |
| virtual void | ReadListElement (int32 keyword, TMCiostream &stream, TMCPtrArray< void > *list) |
| virtual void | Write (TMCiostream &stream) const |
| virtual void | WriteAttributes (TMCiostream &stream) const |
| virtual void | WriteListAttribute (int32 keyword, TMCiostream &stream, TMCPtrArray< void > *list) const |
| virtual void | WriteListElement (int32 listKeyword, TMCiostream &stream, TMCPtrArray< void > *list, int32 index) const |
| virtual void | WriteListNbAttribute (int32 keyword, TMCiostream &stream, int32 numElements) const |
| void | DoWriteWithKeyword (TMCiostream &stream, int32 keyword) const |
| void | DoReadSkipKeyword (TMCiostream &stream) |
| virtual FourCharT | GetKeyword () const |
Static Public Attributes | |
| boolean | sDidSkip |
| boolean | sDoSkip |
Protected Member Functions | |
| ~TMCStreamBased () | |
Using Write() or DoWriteWithKeyword(): Write() is to be used when an object 'knows' its own keyword. However, it is generaly more convenient to use DoWriteWithKeyword(), for the following reason. Say you have an object that has another object as a field. In ReadAttribute(), you catch the field's keyword, instance the object, and call fSubObject->Read(). Fine. In WriteAttributes() you have two choices. If you want to use Write(), you will have to override the GetKeyword() method of the sub-object. The problem with this is that you end up with the field keyword defined at two different places: in the main object's ReadAttribute(), and in the sub-object's GetKeyword(). For this reason, it is better to call DoWriteWithKeyword() instead, so the sub-object's keyword is at the same level: in ReadAttribute() and WriteAttributes() of the main object.
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
Use this to read the top level of file that don't have begin and end tokens around them |
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
1.3.9.1