|
|
|
@ -190,20 +190,20 @@ namespace dlib
|
|
|
|
|
case CR:
|
|
|
|
|
ch = '\r';
|
|
|
|
|
if (out.sputn(&ch,1)!=1)
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
break;
|
|
|
|
|
case LF:
|
|
|
|
|
ch = '\n';
|
|
|
|
|
if (out.sputn(&ch,1)!=1)
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
break;
|
|
|
|
|
case CRLF:
|
|
|
|
|
ch = '\r';
|
|
|
|
|
if (out.sputn(&ch,1)!=1)
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
ch = '\n';
|
|
|
|
|
if (out.sputn(&ch,1)!=1)
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
DLIB_CASSERT(false,"this should never happen");
|
|
|
|
@ -235,7 +235,7 @@ namespace dlib
|
|
|
|
|
// write the encoded bytes to the output stream
|
|
|
|
|
if (out.sputn(reinterpret_cast<char*>(&outbuf),4)!=4)
|
|
|
|
|
{
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get 3 more input bytes
|
|
|
|
@ -265,7 +265,7 @@ namespace dlib
|
|
|
|
|
// write the encoded bytes to the output stream
|
|
|
|
|
if (out.sputn(reinterpret_cast<char*>(&outbuf),4)!=4)
|
|
|
|
|
{
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -292,7 +292,7 @@ namespace dlib
|
|
|
|
|
// write the encoded bytes to the output stream
|
|
|
|
|
if (out.sputn(reinterpret_cast<char*>(&outbuf),4)!=4)
|
|
|
|
|
{
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
@ -370,7 +370,7 @@ namespace dlib
|
|
|
|
|
// write the encoded bytes to the output stream
|
|
|
|
|
if (out.sputn(reinterpret_cast<char*>(&outbuf),outsize)!=outsize)
|
|
|
|
|
{
|
|
|
|
|
throw std::ios_base::failure("error occured in the base64 object");
|
|
|
|
|
throw std::ios_base::failure("error occurred in the base64 object");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|