bool testSocket::localReceiveLine(vmime::string& line) { vmime::size_t eol; if ((eol = m_outBuffer.find('\n')) != vmime::string::npos) { line = vmime::string(m_outBuffer.begin(), m_outBuffer.begin() + eol); if (!line.empty() && line[line.length() - 1] == '\r') line.erase(line.end() - 1, line.end()); m_outBuffer.erase(m_outBuffer.begin(), m_outBuffer.begin() + eol + 1); return true; } return false; }
int getMonth(vmime::string mstr) { std::transform(mstr.begin(), mstr.end(), mstr.begin(), ::tolower); std::map <vmime::string, vmime::datetime::Months>::const_iterator c_it = m_monthMap.find(mstr); if (c_it != m_monthMap.end()) return c_it->second; return -1; }