UtilStream.cxx

Go to the documentation of this file.
00001 #include "UtilStream.hxx"
00002 
00003 using namespace std;
00004 
00005 void Util::eat_whitespace(std::istream& is)
00006 {
00007     char c;
00008     while (is.get(c)) {
00009         if (!isspace(c)) {
00010             is.putback(c);
00011             break;
00012         }
00013     }
00014 }
00015 
00016 std::string Util::read_quoted_string(std::istream& is)
00017 {
00018     eat_whitespace(is);
00019 
00020     char c;
00021 
00022     if (!is.get(c)) return "";
00023     if (c == '\'') {
00024         string stot;
00025         while (is.get(c)) {
00026             if (c == '\'') break;
00027             stot += c;
00028         }
00029         return stot;
00030     }
00031     else {
00032         is.putback(c);
00033         return "";
00034     }
00035 }

Generated on 11 Aug 2013 for SKDatabase by  doxygen 1.6.1