--- smsdaemon/util.cpp 2008/11/02 20:14:20 114 +++ smsdaemon/util.cpp 2008/12/07 00:59:05 132 @@ -344,6 +344,29 @@ return (pclose(p)); } + string readfile(string filename) + { + string str; + ifstream in(filename.c_str()); + if (in) + { + char buffer[2048]; + in.read(buffer, 2047); + buffer[ in.gcount() ] = 0; + str = string(buffer); + in.close(); + } + else + { + string message = "Could no open "; + message += filename; + throw std::runtime_error(message); + } + return str; + } + + + }