|
|
@ -514,19 +514,20 @@ namespace data |
|
|
|
m_BufferLen += privateKeys.GetPublic ()->GetSignatureLen (); |
|
|
|
m_BufferLen += privateKeys.GetPublic ()->GetSignatureLen (); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RouterInfo::SaveToFile (const std::string& fullPath) |
|
|
|
bool RouterInfo::SaveToFile (const std::string& fullPath) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_FullPath = fullPath; |
|
|
|
m_FullPath = fullPath; |
|
|
|
if (m_Buffer) |
|
|
|
if (!m_Buffer) { |
|
|
|
{ |
|
|
|
LogPrint (eLogError, "RouterInfo: Can't save, m_Buffer == NULL"); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
std::ofstream f (fullPath, std::ofstream::binary | std::ofstream::out); |
|
|
|
std::ofstream f (fullPath, std::ofstream::binary | std::ofstream::out); |
|
|
|
if (f.is_open ()) |
|
|
|
if (!f.is_open ()) { |
|
|
|
f.write ((char *)m_Buffer, m_BufferLen); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
LogPrint(eLogError, "RouterInfo: Can't save to ", fullPath); |
|
|
|
LogPrint(eLogError, "RouterInfo: Can't save to ", fullPath); |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
f.write ((char *)m_Buffer, m_BufferLen); |
|
|
|
LogPrint (eLogError, "RouterInfo: Can't save, m_Buffer == NULL"); |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_t RouterInfo::ReadString (char * str, std::istream& s) |
|
|
|
size_t RouterInfo::ReadString (char * str, std::istream& s) |
|
|
|