virtual std::basic_ofstream<Char> &Serialize(std::basic_ofstream<Char> &to) const { items_t::size_type size = items.size(); Item::Serialize(to).write((Char*)&size, sizeof(size)/sizeof(Char)); for(items_t::const_iterator it = items.begin(); it != items.end(); ++it) { (*it)->Serialize(to); } return to; }
virtual HANDLE Serialize(HANDLE File) const { if(!Item::Serialize(File)) return 0; unsigned long written; items_t::size_type size = items.size(); if(!WriteFile(File, &size, sizeof(size), &written, 0) || written != sizeof(size)) return 0; for(items_t::const_iterator it = items.begin(); it != items.end(); ++it) { if(!((*it)->Serialize(File))) return 0; } return File; }