mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
Removed some std::ostringstream.
To be continued. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5103 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
60a68210d5
commit
83bd45caa4
22 changed files with 399 additions and 755 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <time.h>
|
||||
#include "pqi/pqiipset.h"
|
||||
#include "util/rsstring.h"
|
||||
|
||||
bool pqiIpAddress::sameAddress(const pqiIpAddress &a) const
|
||||
{
|
||||
|
@ -192,16 +193,13 @@ void pqiIpAddrList::loadTlv(RsTlvIpAddrSet &tlvAddrs)
|
|||
|
||||
|
||||
|
||||
void pqiIpAddrList::printIpAddressList(std::ostream &out) const
|
||||
void pqiIpAddrList::printIpAddressList(std::string &out) const
|
||||
{
|
||||
std::list<pqiIpAddress>::const_iterator it;
|
||||
time_t now = time(NULL);
|
||||
for(it = mAddrs.begin(); it != mAddrs.end(); it++)
|
||||
{
|
||||
out << rs_inet_ntoa(it->mAddr.sin_addr) << ":"
|
||||
<< ntohs(it->mAddr.sin_port) << " ( "
|
||||
<< now - it->mSeenTime << " old) " << std::endl;
|
||||
|
||||
rs_sprintf_append(out, "%s:%u ( %ld old)\n", rs_inet_ntoa(it->mAddr.sin_addr).c_str(), ntohs(it->mAddr.sin_port), now - it->mSeenTime);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -254,14 +252,13 @@ bool pqiIpAddrSet::updateAddrs(const pqiIpAddrSet &addrs)
|
|||
|
||||
|
||||
|
||||
void pqiIpAddrSet::printAddrs(std::ostream &out) const
|
||||
void pqiIpAddrSet::printAddrs(std::string &out) const
|
||||
{
|
||||
out << "Local Addresses: ";
|
||||
out += "Local Addresses: ";
|
||||
mLocal.printIpAddressList(out);
|
||||
out << std::endl;
|
||||
out << "Ext Addresses: ";
|
||||
out += "\nExt Addresses: ";
|
||||
mExt.printIpAddressList(out);
|
||||
out << std::endl;
|
||||
out += "\n";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue