Add ostream support for StoreEntry

From: Robert Collins <robertc@dont-contact.us>
Date: Sun, 30 Apr 2006 10:44:18 +1000

This is a proof of concept patch. On the way to making ufsdump link a
much smaller section of squid, I found that anything using Packer
requires all of the store.

This patch addresses that by adding a replacement for Packer using the C
++ ostream facility:

  StoreEntryStream stream(anEntry);
  stream << "some text" << std::setw(4) <<"!";
  stream.flush();

is equivalent to:
  Packer p;
  packerToStoreInit(p, anEntry);
  packerPrintf("some text %-4s" , "!");
  packerClean(p);

but doesn't require typecasting variables that change width from 32 to
64 bit platforms.

It still requires store.o linked in, but the only remaining call to need
that is the storeLockObject call, and I plan to fix that shortly.

Thoughts? opinions?

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Received on Sat Apr 29 2006 - 18:44:55 MDT

This archive was generated by hypermail pre-2.1.9 : Mon May 01 2006 - 12:00:04 MDT