Removed some std::ostringstream.

To be continued.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5109 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-04-18 21:20:37 +00:00
parent 9aee68a2a9
commit b71eeadf95
9 changed files with 1865 additions and 1925 deletions

View File

@ -274,9 +274,7 @@ void convertBdPeerToRsDhtPeer(RsDhtPeer &peer, const bdPeer &int_peer)
peer.mDhtId = out.str(); peer.mDhtId = out.str();
std::ostringstream addr; rs_sprintf(peer.mAddr, "%s:%u", rs_inet_ntoa(int_peer.mPeerId.addr.sin_addr).c_str(), ntohs(int_peer.mPeerId.addr.sin_port));
addr << rs_inet_ntoa(int_peer.mPeerId.addr.sin_addr) << ":" << ntohs(int_peer.mPeerId.addr.sin_port);
peer.mAddr = addr.str();
peer.mLastSendTime = int_peer.mLastSendTime; peer.mLastSendTime = int_peer.mLastSendTime;
peer.mLastRecvTime = int_peer.mLastRecvTime; peer.mLastRecvTime = int_peer.mLastRecvTime;
@ -333,23 +331,9 @@ void convertDhtPeerDetailsToRsDhtNetPeer(RsDhtNetPeer &status, const DhtPeerDeta
void convertUdpRelayEndtoRsDhtRelayEnd(RsDhtRelayEnd &end, const UdpRelayEnd &int_end) void convertUdpRelayEndtoRsDhtRelayEnd(RsDhtRelayEnd &end, const UdpRelayEnd &int_end)
{ {
{ rs_sprintf(end.mLocalAddr, "%s:%u", rs_inet_ntoa(int_end.mLocalAddr.sin_addr).c_str(), ntohs(int_end.mLocalAddr.sin_port));
std::ostringstream addr; rs_sprintf(end.mProxyAddr, "%s:%u", rs_inet_ntoa(int_end.mProxyAddr.sin_addr).c_str(), ntohs(int_end.mProxyAddr.sin_port));
addr << rs_inet_ntoa(int_end.mLocalAddr.sin_addr) << ":" << ntohs(int_end.mLocalAddr.sin_port); rs_sprintf(end.mRemoteAddr, "%s:%u", rs_inet_ntoa(int_end.mRemoteAddr.sin_addr).c_str(), ntohs(int_end.mRemoteAddr.sin_port));
end.mLocalAddr = addr.str();
}
{
std::ostringstream addr;
addr << rs_inet_ntoa(int_end.mProxyAddr.sin_addr) << ":" << ntohs(int_end.mProxyAddr.sin_port);
end.mProxyAddr = addr.str();
}
{
std::ostringstream addr;
addr << rs_inet_ntoa(int_end.mRemoteAddr.sin_addr) << ":" << ntohs(int_end.mRemoteAddr.sin_port);
end.mRemoteAddr = addr.str();
}
end.mCreateTS = 0; end.mCreateTS = 0;
return; return;
@ -357,26 +341,16 @@ void convertUdpRelayEndtoRsDhtRelayEnd(RsDhtRelayEnd &end, const UdpRelayEnd &in
void convertUdpRelayProxytoRsDhtRelayProxy(RsDhtRelayProxy &proxy, const UdpRelayProxy &int_proxy) void convertUdpRelayProxytoRsDhtRelayProxy(RsDhtRelayProxy &proxy, const UdpRelayProxy &int_proxy)
{ {
{ rs_sprintf(proxy.mSrcAddr, "%s:%u", rs_inet_ntoa(int_proxy.mAddrs.mSrcAddr.sin_addr).c_str(), ntohs(int_proxy.mAddrs.mSrcAddr.sin_port));
std::ostringstream addr; rs_sprintf(proxy.mDestAddr, "%s:%u", rs_inet_ntoa(int_proxy.mAddrs.mDestAddr.sin_addr).c_str(), ntohs(int_proxy.mAddrs.mDestAddr.sin_port));
addr << rs_inet_ntoa(int_proxy.mAddrs.mSrcAddr.sin_addr) << ":" << ntohs(int_proxy.mAddrs.mSrcAddr.sin_port);
proxy.mSrcAddr = addr.str();
}
{ proxy.mBandwidth = int_proxy.mBandwidth;
std::ostringstream addr; proxy.mRelayClass = int_proxy.mRelayClass;
addr << rs_inet_ntoa(int_proxy.mAddrs.mDestAddr.sin_addr) << ":" << ntohs(int_proxy.mAddrs.mDestAddr.sin_port); proxy.mLastTS = int_proxy.mLastTS;
proxy.mDestAddr = addr.str();
}
proxy.mBandwidth = int_proxy.mBandwidth;
proxy.mRelayClass = int_proxy.mRelayClass;
proxy.mLastTS = int_proxy.mLastTS;
proxy.mCreateTS = 0; proxy.mCreateTS = 0;
//proxy.mDataSize = int_proxy.mDataSize; //proxy.mDataSize = int_proxy.mDataSize;
//proxy.mLastBandwidthTS = int_proxy.mLastBandwidthTS; //proxy.mLastBandwidthTS = int_proxy.mLastBandwidthTS;
} }
RsDhtPeer::RsDhtPeer() RsDhtPeer::RsDhtPeer()

View File

@ -2169,10 +2169,7 @@ void p3BitDht::Feedback_Connected(std::string pid)
dpd->mConnectLogic.updateCb(CSB_UPDATE_CONNECTED); dpd->mConnectLogic.updateCb(CSB_UPDATE_CONNECTED);
std::ostringstream msg; rs_sprintf(dpd->mPeerConnectMsg, "Connected in %ld secs", dpd->mPeerConnectTS - dpd->mPeerConnectUdpTS);
msg << "Connected in " << dpd->mPeerConnectTS - dpd->mPeerConnectUdpTS;
msg << " secs";
dpd->mPeerConnectMsg = msg.str();
// Remove the Connection Request. // Remove the Connection Request.
if (dpd->mPeerReqState == RSDHT_PEERREQ_RUNNING) if (dpd->mPeerReqState == RSDHT_PEERREQ_RUNNING)
@ -2290,10 +2287,7 @@ void p3BitDht::UdpConnectionFailed_locked(DhtPeerDetails *dpd)
dpd->mPeerConnectState = RSDHT_PEERCONN_DISCONNECTED; dpd->mPeerConnectState = RSDHT_PEERCONN_DISCONNECTED;
dpd->mPeerConnectClosedTS = time(NULL); dpd->mPeerConnectClosedTS = time(NULL);
std::ostringstream msg; rs_sprintf(dpd->mPeerConnectMsg, "Closed, Alive for: %ld secs", dpd->mPeerConnectClosedTS - dpd->mPeerConnectTS);
msg << "Closed, Alive for: " << dpd->mPeerConnectClosedTS - dpd->mPeerConnectTS;
msg << " secs";
dpd->mPeerConnectMsg = msg.str();
} }

View File

@ -907,17 +907,17 @@ std::string ProcessPGPmeError(gpgme_error_t ERR)
gpgme_err_code_t code = gpgme_err_code(ERR); gpgme_err_code_t code = gpgme_err_code(ERR);
gpgme_err_source_t src = gpgme_err_source(ERR); gpgme_err_source_t src = gpgme_err_source(ERR);
std::ostringstream ss ; std::string s ;
if(code > 0) if(code > 0)
{ {
ss << "GPGme ERROR: Code: " << code << " Source: " << src << std::endl; rs_sprintf(s, "GPGme ERROR: Code: %d Source: %d\n", code, src);
ss << "GPGme ERROR: " << gpgme_strerror(ERR) << std::endl; rs_sprintf_append(s, "GPGme ERROR: %s\n", gpgme_strerror(ERR));
} }
else else
return std::string("Unknown error") ; return std::string("Unknown error") ;
return ss.str() ; return s ;
} }
void print_pgpme_verify_summary(unsigned int summary) void print_pgpme_verify_summary(unsigned int summary)
@ -1844,9 +1844,8 @@ int AuthGPGimpl::privateTrustCertificate(const std::string &id, int trustlvl)
gpgme_key_t trustKey = trustCert.key; gpgme_key_t trustKey = trustCert.key;
std::string trustString; std::string trustString;
std::ostringstream trustStrOut; rs_sprintf(trustString, "%d", trustlvl);
trustStrOut << trustlvl; class TrustParams sparams(trustString);
class TrustParams sparams(trustStrOut.str());
class EditParams params(TRUST_START, &sparams); class EditParams params(TRUST_START, &sparams);
gpgme_data_t out; gpgme_data_t out;
gpg_error_t ERR; gpg_error_t ERR;
@ -1875,11 +1874,10 @@ static std::string setKeyPairParams(bool useRsa, unsigned int blen,
std::string name, std::string comment, std::string email, std::string name, std::string comment, std::string email,
std::string inPassphrase) std::string inPassphrase)
{ {
std::ostringstream params; std::string params = "<GnupgKeyParms format=\"internal\">\n";
params << "<GnupgKeyParms format=\"internal\">"<< std::endl;
if (useRsa) if (useRsa)
{ {
params << "Key-Type: RSA"<< std::endl; params += "Key-Type: RSA\n";
if (blen < 1024) if (blen < 1024)
{ {
#ifdef GPG_DEBUG #ifdef GPG_DEBUG
@ -1888,23 +1886,23 @@ static std::string setKeyPairParams(bool useRsa, unsigned int blen,
blen = 1024; blen = 1024;
} }
blen = ((blen / 512) * 512); /* make multiple of 512 */ blen = ((blen / 512) * 512); /* make multiple of 512 */
params << "Key-Length: "<< blen << std::endl; rs_sprintf_append(params, "Key-Length: %u\n", blen);
} }
else else
{ {
params << "Key-Type: DSA"<< std::endl; params += "Key-Type: DSA\n";
params << "Key-Length: 1024"<< std::endl; params += "Key-Length: 1024\n";
params << "Subkey-Type: ELG-E"<< std::endl; params += "Subkey-Type: ELG-E\n";
params << "Subkey-Length: 1024"<< std::endl; params += "Subkey-Length: 1024\n";
} }
params << "Name-Real: "<< name << std::endl; params += "Name-Real: " + name + "\n";
params << "Name-Comment: "<< comment << std::endl; params += "Name-Comment: " + comment + "\n";
params << "Name-Email: "<< email << std::endl; params += "Name-Email: " + email + "\n";
params << "Expire-Date: 0"<< std::endl; params += "Expire-Date: 0\n";
params << "Passphrase: "<< inPassphrase << std::endl; params += "Passphrase: " + inPassphrase + "\n";
params << "</GnupgKeyParms>"<< std::endl; params += "</GnupgKeyParms>\n";
return params.str(); return params;
} }

View File

@ -27,6 +27,7 @@
#include "serialiser/rsbaseserial.h" #include "serialiser/rsbaseserial.h"
#include "serialiser/rsserial.h" #include "serialiser/rsserial.h"
#include "util/rsthreads.h" #include "util/rsthreads.h"
#include "util/rsstring.h"
#include <math.h> #include <math.h>
#include <map> #include <map>
@ -292,11 +293,11 @@ uint32_t RsSerialiser::size(RsItem *item)
#ifdef RSSERIAL_ERROR_DEBUG #ifdef RSSERIAL_ERROR_DEBUG
std::cerr << "RsSerialiser::size() ERROR serialiser missing!"; std::cerr << "RsSerialiser::size() ERROR serialiser missing!";
std::ostringstream out; std::string out;
out << std::hex << item->PacketId() << std::dec; rs_sprintf(out, "%x", item->PacketId());
std::cerr << "RsSerialiser::size() PacketId: "; std::cerr << "RsSerialiser::size() PacketId: ";
std::cerr << out.str(); std::cerr << out;
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
return 0; return 0;
@ -305,10 +306,9 @@ uint32_t RsSerialiser::size(RsItem *item)
} }
#ifdef RSSERIAL_DEBUG #ifdef RSSERIAL_DEBUG
std::ostringstream out; std::string out;
out << std::hex << "RsSerialiser::size() Item->PacketId(): " << item->PacketId(); rs_sprintf(out, "RsSerialiser::size() Item->PacketId(): %x matched to Serialiser Type: %lu", item->PacketId(), type);
out << " matched to Serialiser Type: " << type; std::cerr << out << std::endl;
std::cerr << out.str() << std::endl;
#endif #endif
return (it->second)->size(item); return (it->second)->size(item);
@ -333,11 +333,11 @@ bool RsSerialiser::serialise (RsItem *item, void *data, uint32_t *size)
#ifdef RSSERIAL_ERROR_DEBUG #ifdef RSSERIAL_ERROR_DEBUG
std::cerr << "RsSerialiser::serialise() ERROR serialiser missing!"; std::cerr << "RsSerialiser::serialise() ERROR serialiser missing!";
std::ostringstream out; std::string out;
out << std::hex << item->PacketId() << std::dec; rs_sprintf(out, "%x", item->PacketId());
std::cerr << "RsSerialiser::serialise() PacketId: "; std::cerr << "RsSerialiser::serialise() PacketId: ";
std::cerr << out.str(); std::cerr << out;
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
return false; return false;
@ -346,10 +346,9 @@ bool RsSerialiser::serialise (RsItem *item, void *data, uint32_t *size)
} }
#ifdef RSSERIAL_DEBUG #ifdef RSSERIAL_DEBUG
std::ostringstream out; std::string out;
out << std::hex << "RsSerialiser::serialise() Item->PacketId(): " << item->PacketId(); rs_sprintf(out, "RsSerialiser::serialise() Item->PacketId(): %x matched to Serialiser Type: %lu", item->PacketId(), type);
out << " matched to Serialiser Type: " << type; std::cerr << out << std::endl;
std::cerr << out.str() << std::endl;
#endif #endif
return (it->second)->serialise(item, data, size); return (it->second)->serialise(item, data, size);
@ -401,12 +400,11 @@ RsItem * RsSerialiser::deserialise(void *data, uint32_t *size)
#ifdef RSSERIAL_ERROR_DEBUG #ifdef RSSERIAL_ERROR_DEBUG
std::cerr << "RsSerialiser::deserialise() ERROR deserialiser missing!"; std::cerr << "RsSerialiser::deserialise() ERROR deserialiser missing!";
std::ostringstream out; std::string out;
out << std::hex << getRsItemId(data) << std::dec; rs_sprintf(out, "%x", getRsItemId(data));
std::cerr << "RsSerialiser::deserialise() PacketId: "; std::cerr << "RsSerialiser::deserialise() PacketId: ";
std::cerr << out.str(); std::cerr << out << std::endl;
std::cerr << std::endl;
#endif #endif
return NULL; return NULL;
} }

View File

@ -34,32 +34,30 @@
/* print out a packet */ /* print out a packet */
#include <stdlib.h> #include <stdlib.h>
#include <iostream> #include <iostream>
#include <sstream>
#include <iomanip> #include <iomanip>
#include <vector> #include <vector>
#include "serialiser/rstlvbase.h" #include "serialiser/rstlvbase.h"
#include "serialiser/rstlvtypes.h" #include "serialiser/rstlvtypes.h"
#include "util/utest.h" #include "util/utest.h"
#include "util/rsstring.h"
void displayRawPacket(std::ostream &out, void *data, uint32_t size) void displayRawPacket(std::ostream &out, void *data, uint32_t size)
{ {
uint32_t i; uint32_t i;
std::ostringstream sout; std::string sout;
sout << "DisplayRawPacket: Size: " << size; rs_sprintf(sout, "DisplayRawPacket: Size: %ld", size);
sout << std::hex;
for(i = 0; i < size; i++) for(i = 0; i < size; i++)
{ {
if (i % 16 == 0) if (i % 16 == 0)
{ {
sout << std::endl; sout += "\n";
} }
sout << std::setw(2) << std::setfill('0') rs_sprintf_append(sout, "%02x:", (int) (((unsigned char *) data)[i]));
<< (int) (((unsigned char *) data)[i]) << ":";
} }
sout << std::endl;
out << sout.str(); out << sout << std::endl;
} }

View File

@ -1,7 +1,7 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <sstream>
#include "rstunnelitems.h" #include "rstunnelitems.h"
#include "util/rsstring.h"
// -----------------------------------------------------------------------------------// // -----------------------------------------------------------------------------------//
// -------------------------------- Serialization. --------------------------------- // // -------------------------------- Serialization. --------------------------------- //
@ -184,21 +184,19 @@ bool RsTunnelHandshakeItem::serialize(void *data,uint32_t& pktsize)
void displayRawPacket(std::ostream &out, void *data, uint32_t size) void displayRawPacket(std::ostream &out, void *data, uint32_t size)
{ {
uint32_t i; uint32_t i;
std::ostringstream sout; std::string sout;
sout << "DisplayRawPacket: Size: " << size; rs_sprintf(sout, "DisplayRawPacket: Size: %ld", size);
sout << std::hex;
for(i = 0; i < size; i++) for(i = 0; i < size; i++)
{ {
if (i % 16 == 0) if (i % 16 == 0)
{ {
sout << std::endl; sout += "\n";
} }
sout << std::setw(2) << std::setfill('0') rs_sprintf_append(sout, "%02x:", (int) (((unsigned char *) data)[i]));
<< (int) (((unsigned char *) data)[i]) << ":";
} }
sout << std::endl;
out << sout.str(); out << sout << std::endl;
} }
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,6 @@
#include <map> #include <map>
#include <string> #include <string>
#include <sstream>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <string.h> #include <string.h>
@ -194,10 +193,8 @@ CXML_List<T, XML_ELEMENT_NAME, XML_LIST_NAME>::CXML_List(
(*this)[upnpElement->GetKey()] = upnpElement; (*this)[upnpElement->GetKey()] = upnpElement;
++i; ++i;
} }
std::ostringstream msg; std::cerr << "\n " << XML_LIST_NAME << ": " <<
msg << "\n " << XML_LIST_NAME << ": " <<
i << " " << XML_ELEMENT_NAME << "s."; i << " " << XML_ELEMENT_NAME << "s.";
std::cerr << msg;
} }

View File

@ -26,7 +26,6 @@
#include "zeroconf/p3zeroconf.h" #include "zeroconf/p3zeroconf.h"
#include <openssl/sha.h> #include <openssl/sha.h>
#include <sstream>
#include <iostream> #include <iostream>
#include "pqi/authgpg.h" #include "pqi/authgpg.h"
@ -126,14 +125,9 @@ bool p3ZeroConf::getNetworkStats(uint32_t &netsize, uint32_t &localnetsize)
void p3ZeroConf::createTxtRecord() void p3ZeroConf::createTxtRecord()
{ {
RsStackMutex stack(mZcMtx); /****** STACK LOCK MUTEX *******/ RsStackMutex stack(mZcMtx); /****** STACK LOCK MUTEX *******/
std::ostringstream gpgidout;
std::ostringstream sslidout;
gpgidout << "gpgid=" << mOwnGpgId; std::string gpgid = "gpgid=" + mOwnGpgId;
sslidout << "sslid=" << mOwnSslId; std::string sslid = "sslid=" + mOwnSslId;
std::string gpgid = gpgidout.str();
std::string sslid = sslidout.str();
mTextRecord += (char) gpgid.length(); mTextRecord += (char) gpgid.length();
mTextRecord += gpgid; mTextRecord += gpgid;
@ -1248,110 +1242,110 @@ int p3ZeroConf::locked_stopQueryIp()
std::string displayDNSServiceError(DNSServiceErrorType errcode) std::string displayDNSServiceError(DNSServiceErrorType errcode)
{ {
std::ostringstream str; std::string str;
switch(errcode) switch(errcode)
{ {
default: default:
str << "kDNSServiceErr_??? UNKNOWN-CODE"; str = "kDNSServiceErr_??? UNKNOWN-CODE";
break; break;
case kDNSServiceErr_NoError: case kDNSServiceErr_NoError:
str << "kDNSServiceErr_NoError"; str = "kDNSServiceErr_NoError";
break; break;
case kDNSServiceErr_Unknown: case kDNSServiceErr_Unknown:
str << "kDNSServiceErr_Unknown"; str = "kDNSServiceErr_Unknown";
break; break;
case kDNSServiceErr_NoSuchName: case kDNSServiceErr_NoSuchName:
str << "kDNSServiceErr_NoSuchName"; str = "kDNSServiceErr_NoSuchName";
break; break;
case kDNSServiceErr_NoMemory: case kDNSServiceErr_NoMemory:
str << "kDNSServiceErr_NoMemory"; str = "kDNSServiceErr_NoMemory";
break; break;
case kDNSServiceErr_BadParam: case kDNSServiceErr_BadParam:
str << "kDNSServiceErr_BadParam"; str = "kDNSServiceErr_BadParam";
break; break;
case kDNSServiceErr_BadReference: case kDNSServiceErr_BadReference:
str << "kDNSServiceErr_BadReference"; str = "kDNSServiceErr_BadReference";
break; break;
case kDNSServiceErr_BadState: case kDNSServiceErr_BadState:
str << "kDNSServiceErr_BadState"; str = "kDNSServiceErr_BadState";
break; break;
case kDNSServiceErr_BadFlags: case kDNSServiceErr_BadFlags:
str << "kDNSServiceErr_BadFlags"; str = "kDNSServiceErr_BadFlags";
break; break;
case kDNSServiceErr_Unsupported: case kDNSServiceErr_Unsupported:
str << "kDNSServiceErr_Unsupported"; str = "kDNSServiceErr_Unsupported";
break; break;
case kDNSServiceErr_NotInitialized: case kDNSServiceErr_NotInitialized:
str << "kDNSServiceErr_NotInitialized"; str = "kDNSServiceErr_NotInitialized";
break; break;
case kDNSServiceErr_AlreadyRegistered: case kDNSServiceErr_AlreadyRegistered:
str << "kDNSServiceErr_AlreadyRegistered"; str = "kDNSServiceErr_AlreadyRegistered";
break; break;
case kDNSServiceErr_NameConflict: case kDNSServiceErr_NameConflict:
str << "kDNSServiceErr_NameConflict"; str = "kDNSServiceErr_NameConflict";
break; break;
case kDNSServiceErr_Invalid: case kDNSServiceErr_Invalid:
str << "kDNSServiceErr_Invalid"; str = "kDNSServiceErr_Invalid";
break; break;
case kDNSServiceErr_Firewall: case kDNSServiceErr_Firewall:
str << "kDNSServiceErr_Firewall"; str = "kDNSServiceErr_Firewall";
break; break;
case kDNSServiceErr_Incompatible: case kDNSServiceErr_Incompatible:
str << "kDNSServiceErr_Incompatible"; str = "kDNSServiceErr_Incompatible";
break; break;
case kDNSServiceErr_BadInterfaceIndex: case kDNSServiceErr_BadInterfaceIndex:
str << "kDNSServiceErr_BadInterfaceIndex"; str = "kDNSServiceErr_BadInterfaceIndex";
break; break;
case kDNSServiceErr_Refused: case kDNSServiceErr_Refused:
str << "kDNSServiceErr_Refused"; str = "kDNSServiceErr_Refused";
break; break;
case kDNSServiceErr_NoSuchRecord: case kDNSServiceErr_NoSuchRecord:
str << "kDNSServiceErr_NoSuchRecord"; str = "kDNSServiceErr_NoSuchRecord";
break; break;
case kDNSServiceErr_NoAuth: case kDNSServiceErr_NoAuth:
str << "kDNSServiceErr_NoAuth"; str = "kDNSServiceErr_NoAuth";
break; break;
case kDNSServiceErr_NoSuchKey: case kDNSServiceErr_NoSuchKey:
str << "kDNSServiceErr_NoSuchKey"; str = "kDNSServiceErr_NoSuchKey";
break; break;
case kDNSServiceErr_NATTraversal: case kDNSServiceErr_NATTraversal:
str << "kDNSServiceErr_NATTraversal"; str = "kDNSServiceErr_NATTraversal";
break; break;
case kDNSServiceErr_DoubleNAT: case kDNSServiceErr_DoubleNAT:
str << "kDNSServiceErr_DoubleNAT"; str = "kDNSServiceErr_DoubleNAT";
break; break;
case kDNSServiceErr_BadTime: case kDNSServiceErr_BadTime:
str << "kDNSServiceErr_BadTime"; str = "kDNSServiceErr_BadTime";
break; break;
case kDNSServiceErr_BadSig: case kDNSServiceErr_BadSig:
str << "kDNSServiceErr_BadSig"; str = "kDNSServiceErr_BadSig";
break; break;
case kDNSServiceErr_BadKey: case kDNSServiceErr_BadKey:
str << "kDNSServiceErr_BadKey"; str = "kDNSServiceErr_BadKey";
break; break;
case kDNSServiceErr_Transient: case kDNSServiceErr_Transient:
str << "kDNSServiceErr_Transient"; str = "kDNSServiceErr_Transient";
break; break;
case kDNSServiceErr_ServiceNotRunning: case kDNSServiceErr_ServiceNotRunning:
str << "kDNSServiceErr_ServiceNotRunning"; str = "kDNSServiceErr_ServiceNotRunning";
break; break;
case kDNSServiceErr_NATPortMappingUnsupported: case kDNSServiceErr_NATPortMappingUnsupported:
str << "kDNSServiceErr_NATPortMappingUnsupported"; str = "kDNSServiceErr_NATPortMappingUnsupported";
break; break;
case kDNSServiceErr_NATPortMappingDisabled: case kDNSServiceErr_NATPortMappingDisabled:
str << "kDNSServiceErr_NATPortMappingDisabled"; str = "kDNSServiceErr_NATPortMappingDisabled";
break; break;
#if 0 #if 0
case kDNSServiceErr_NoRouter: case kDNSServiceErr_NoRouter:
str << "kDNSServiceErr_NoRouter"; str = "kDNSServiceErr_NoRouter";
break; break;
case kDNSServiceErr_PollingMode: case kDNSServiceErr_PollingMode:
str << "kDNSServiceErr_PollingMode"; str = "kDNSServiceErr_PollingMode";
break; break;
#endif #endif
} }
return str.str(); return str;
} }