1 #include "ace/OS_NS_string.h"
3 #include "ACEXML/common/StreamFactory.h"
4 #include "ACEXML/common/FileCharStream.h"
5 #include "ACEXML/common/HttpCharStream.h"
8 #include "ACEXML/common/ZipCharStream.h"
13 ACEXML_StreamFactory::create_stream (const ACEXML_Char
* uri
)
17 ACEXML_FileCharStream
* fstream
= 0;
18 ACEXML_HttpCharStream
* hstream
= 0;
20 if (ACE_OS::strstr (uri
, ACE_TEXT("ftp://")) != 0)
24 else if (ACE_OS::strstr (uri
, ACE_TEXT ("http://")) != 0)
26 ACE_NEW_RETURN (hstream
, ACEXML_HttpCharStream
, 0);
27 if (hstream
->open (uri
) != -1)
32 if (ACE_OS::strstr (uri
, ACE_TEXT ("file://")) != 0)
33 uri
+= 7; // Skip over file://
34 ACE_NEW_RETURN (fstream
, ACEXML_FileCharStream
, 0);
35 if (fstream
->open (uri
) != -1)
40 ACEXML_ZipCharStream
* zstream
= 0;
41 ACE_NEW_RETURN (zstream
, ACEXML_ZipCharStream
, 0);
42 if (zstream
->open (uri
) != -1)
50 ACEXML_StreamFactory::~ACEXML_StreamFactory ()