WvStreams
wvhttpcomponent.cc
1 /*
2  * Worldvisions Weaver Software:
3  * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4  *
5  * Componentization stuff for wvhttppool.h. Constitutes cheating.
6  */
7 #include "wvhttppool.h"
8 #include "wvmoniker.h"
9 #include "wvistreamlist.h"
10 
11 static WvHttpPool *pool;
12 
13 
14 static void pool_init()
15 {
16  // FIXME: we never free it!
17  if (!pool)
18  {
19  pool = new WvHttpPool;
20  WvIStreamList::globallist.append(pool, false, "pool_init urlpool");
21  }
22 }
23 
24 
25 static IWvStream *creator(WvStringParm s, IObject*)
26 {
27  pool_init();
28  return pool->addurl(WvString("http:%s", s), "GET");
29 }
30 
31 
32 static IWvStream *screator(WvStringParm s, IObject*)
33 {
34  pool_init();
35  return pool->addurl(WvString("https:%s", s), "GET");
36 }
37 
38 
39 static WvMoniker<IWvStream> reg("http", creator);
40 static WvMoniker<IWvStream> regs("https", screator);
IWvStream
Definition: iwvstream.h:24
WvString
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:329
WvMoniker
A type-safe version of WvMonikerBase that lets you provide create functions for object types other th...
Definition: wvmoniker.h:61
IObject
Definition: IObject.h:65
WvHttpPool
Definition: wvhttppool.h:246