[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SV: SV: SV: Directory

> >> >Oh yeah, and another thing. The File class will also need the virtual
> >> >SerializeTo() and SerializeFrom() methods.
> >>
> >> Of course ;)
> >>
> >It'll also need SerializeContentTo(). Perhaps it should be
> >SerializeHeaderTo(), SerializeHeaderFrom() and SerializeContentTo().
> Shouldn't serialization be implemented using operator>> and operator<< ? I
> think that would make a nice and clean API.
No. You can't pass any parameters (well, ok, but then you have to type
"operator>>(blah)", which somehow defeats the porpuse) and if you can
serialize something in several ways, you have a problem, as you only have
one operator>> and one operator<<. Besides, those operators can mean a
number of things, like "add-to" "pass-to" "go-through" "process" etc. Not