Hi Felix, The implementation looks good, except one problem you have already mentioned. You are completely right, it is not allowed to have out-parameter in the constructor. Sorry, my failure. The attached implementation fills the sequence correctly, but unfortunately not the original sequence provided from outside. So we should design it in different way. I would suggest the following changes: - introduce a new interface XSequenceOutputStream derived from XOutputStream, that implements an additional method, kind of "sequence< byte > getWrittenBytes() throws ( NotConnectedException, IOException )" - let the service be derived from the interface - let the service get no arguments in constructor, the sequence will be just an internal member in the implementation
Thus, the user will create the service, that will fill internal sequence while being written, and then return the sequence. Before returning of the stream, the sequence must get the correct length, since for optimization reasons OSequenceOutputStream can let the sequence be longer during the writing. Currently it is done in OSequenceOutputStream::closeOutput(), but we do not need to close the internal stream in case of getWrittenBytes() call. So I would suggest to fix OSequenceOutputStream::flush() so that it sets the correct size to the sequence, and use this method in getWrittenBytes() call. As for the 'O' prefix, it is has no special meaning. There is no name convention regarding class names of service implementations, so it is a matter of taste. :) Best Regards, Mikhail. Zhang Xiaofei wrote: > Hi Mikhail, > > The attachment is the patches to udkapi and comphelper projects, the > compilation to udkapi, offapi, offuh, comphelper projects all passed, > and the application seems running fine after I delivered > comphelp4MSC.dll explicitly to the install directory. Could you help > to review them please? > > This time I have some questions as well: > > The first is about the ctor of SequenceOutputStream, I'm not sure if I > got your statement in our last IRC meeting, that the service > constructor should take sequence of bytes as output parameter, in the > right way. At first I declared the ctor as: > > /_createStreamFromSequence( [out] sequence<byte> aData ); > > _/But then I was informed by the compiler that a parameter of a ctor > may *not* be /out /or /inout, /I modified it to: > > /_createStreamFromSequence( [in] sequence<byte> aData ); > > _/then the compilation passed. However I don't know if this is > semantically correct. Could you please give me some instructions here?/_ > _/ > The second is about naming conventions on classes, I find sometimes a > class has an 'O' before its name, just like OSequenceOutputStream in > /compehelper/inc/seqstream.hxx, and OTempFileService in our first > task, too; but sometimes there isn't, like SequenceInputStream in > seqstream.hxx, what does the 'O' stand for and when is it appropriate > to have it? > Does it has something to do with the class deriving from a typedef-ed > base class, like OSequenceOutputStream_Base and OTempFileBase, I suppose? > > Best Regards, > Felix. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]