Main Page   Namespace List   File List   Examples  

Util.hpp

Go to the documentation of this file.
00001 /*
00002  * (C) Copyright 2002, Schlund+Partner AG
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018 
00031 #ifndef SP_GXML_UTIL_HPP
00032 #define SP_GXML_UTIL_HPP
00033 
00034 // STDC++
00035 #include <string>
00036 #include <fstream>
00037 
00038 namespace SP
00039 {
00040 namespace GXML
00041 {
00042 
00043 //
00044 // istream to string conversion
00045 //
00046 inline std::string istream2String( std::istream & f)
00047 {
00048         std::string result;
00049         const int buflen(1024);
00050         char buffer[buflen];
00051 
00052         while (!f.eof())
00053         {
00054                 f.read(buffer, buflen);
00055                 result.append(buffer, f.gcount());
00056         }
00057         return(result);
00058 }
00059 
00060 }}
00061 #endif

Generated on Thu Jun 3 19:20:12 2004 for sp-gxmlcpp by doxygen1.2.15