HttpCharStream_Test.cpp

Go to the documentation of this file.
00001 // HttpCharStream_Test.cpp,v 1.6 2003/11/07 20:27:29 shuston Exp
00002 
00003 #include "ACEXML/common/HttpCharStream.h"
00004 #include "ace/OS_NS_stdio.h"
00005 #include "ace/OS_main.h"
00006 
00007 int ACE_TMAIN (int, ACE_TCHAR *[])
00008 {
00009   const ACEXML_Char* test = ACE_TEXT("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd");
00010 
00011   const ACEXML_Char* simple = ACE_TEXT("http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent");
00012 
00013   ACEXML_HttpCharStream first;
00014   ACEXML_HttpCharStream second;
00015   ACEXML_Char ch;
00016 
00017   if (first.open (test) != -1)
00018     {
00019       while (first.get (ch) != -1)
00020         ACE_OS::printf ("%c", ch);
00021     }
00022   else
00023     {
00024       first.close();
00025       ACE_ERROR ((LM_ERROR, "Error in opening stream : %m\n"));
00026     }
00027   if (second.open (simple) != -1)
00028     {
00029       while (second.get (ch) != -1)
00030         ACE_OS::printf ("%c", ch);
00031     }
00032   else
00033     {
00034       second.close();
00035       ACE_ERROR ((LM_ERROR, "Error in opening stream : %m\n"));
00036     }
00037   first.close();
00038   second.close();
00039   return 0;
00040 }

Generated on Thu Nov 9 11:45:37 2006 for ACEXML by doxygen 1.3.6