void FileTransfer::PutFile::WriteMessage(Message& msg) const { msg.AddHeader("FileName", _fname); // this should do all the time std::ifstream file(_path, std::ios::in | std::ios::binary); if (!file.is_open()) throw std::runtime_error("Could not open file " + _path); char buffer[4096]; while (!file.eof()) { file.read(buffer, sizeof(buffer)); msg.WriteData(buffer, file.gcount()); } }
void WriteMessage(Message& msg) const { msg.AddHeader("Data", dat); }
void TextSearch::SearchString::WriteMessage(Message& msg) const { msg.AddHeader("SearchString", _str); // this should do all the time msg.AddHeader("NumJobs", _jobs); }