summaryrefslogtreecommitdiff
path: root/ACEXML/tests/HttpCharStream_Test.cpp
blob: 982fbcd4e344bbb708aa00ac48ef95195cfe8dcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// $Id$

#include "ACEXML/common/HttpCharStream.h"

int ACE_TMAIN (int, ACE_TCHAR *[])
{
  const ACEXML_Char* test = ACE_TEXT("http://www.cs.wustl.edu/~nanbor/");

  const ACEXML_Char* simple = ACE_TEXT("http://www.cs.wustl.edu/~kitty/");

  ACEXML_HttpCharStream stream;
  ACEXML_Char ch;

  if (stream.open (test) != -1)
    {
      while (stream.get (ch) != -1)
        ACE_OS::printf ("%c", ch);
      stream.close();
    }
  else
    {
      ACE_ERROR ((LM_ERROR, "Error in opening stream : %m\n"));
    }

  if (stream.open (simple) != -1)
    {
      while (stream.get (ch) != -1)
        ACE_OS::printf ("%c", ch);
    }
  else
    {
      ACE_ERROR ((LM_ERROR, "Error in opening stream : %m\n"));
    }
  return 0;
}