From ccfd534cda6a6e5dd2b0042031b883e856348c04 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 11 May 2010 10:23:17 +0200 Subject: [PATCH] Reformat --- src/gduutil.cpp | 90 ++++++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 47 deletions(-) diff --git a/src/gduutil.cpp b/src/gduutil.cpp index e6574d6..864cb61 100644 --- a/src/gduutil.cpp +++ b/src/gduutil.cpp @@ -24,16 +24,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#include namespace mp = metaproxy_1; // Doxygen doesn't like mp::gdu, so we use this instead namespace mp_util = metaproxy_1::util; - - - std::ostream& std::operator<<(std::ostream& os, Z_GDU& zgdu) { if (zgdu.which == Z_GDU_Z3950) @@ -66,7 +62,6 @@ std::ostream& std::operator<<(std::ostream& os, Z_HTTP_Request& httpreq) return os; } - std::ostream& std::operator<<(std::ostream& os, Z_HTTP_Response& httpres) { os << httpres.code << " "; @@ -76,7 +71,8 @@ std::ostream& std::operator<<(std::ostream& os, Z_HTTP_Response& httpres) std::ostream& std::operator<<(std::ostream& os, Z_Records & rs) { - switch(rs.which) { + switch (rs.which) + { case Z_Records_DBOSD : break; case Z_Records_NSD: @@ -96,7 +92,8 @@ std::ostream& std::operator<<(std::ostream& os, Z_Records & rs) std::ostream& std::operator<<(std::ostream& os, Z_DiagRec& dr) { - switch(dr.which) { + switch (dr.which) + { case Z_DiagRec_defaultFormat: if (dr.u.defaultFormat) os << *(dr.u.defaultFormat); @@ -116,7 +113,8 @@ std::ostream& std::operator<<(std::ostream& os, Z_DefaultDiagFormat& ddf) if (ddf.condition) os << *(ddf.condition) << " "; - switch(ddf.which) { + switch (ddf.which) + { case Z_DefaultDiagFormat_v2Addinfo: os << ddf.u.v2Addinfo; break; @@ -345,8 +343,7 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) case Z_APDU_scanRequest: os << " " << "scanRequest" << " "; { - Z_ScanRequest *sr - = zapdu.u.scanRequest; + Z_ScanRequest *sr = zapdu.u.scanRequest; if (sr) { @@ -377,17 +374,15 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) case Z_APDU_scanResponse: os << " " << "scanResponse" << " "; { - Z_ScanResponse *sr - = zapdu.u.scanResponse; + Z_ScanResponse *sr = zapdu.u.scanResponse; if (sr) { if (!sr->scanStatus) - { os << "OK"; - } else { - switch (*(sr->scanStatus)){ + switch (*sr->scanStatus) + { case Z_Scan_success: os << "OK"; break; @@ -476,48 +471,49 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) break; case Z_APDU_extendedServicesResponse: os << " " << "extendedServicesResponse"; - { - Z_ExtendedServicesResponse *er - = zapdu.u.extendedServicesResponse; - if (er) - { - if (er->operationStatus) - { - os << " "; - switch (*(er->operationStatus)){ - case Z_ExtendedServicesResponse_done: - os << "OK"; - break; - case Z_ExtendedServicesResponse_accepted: - os << "ACCEPT"; - break; - case Z_ExtendedServicesResponse_failure: - if (er->num_diagnostics) - os << "DIAG " << **(er->diagnostics); - else - os << "ERROR"; - break; - default: - os << "unknown"; - } - } - else - os << " -"; - } - } + { + Z_ExtendedServicesResponse *er + = zapdu.u.extendedServicesResponse; + if (er) + { + if (er->operationStatus) + { + os << " "; + switch (*er->operationStatus) + { + case Z_ExtendedServicesResponse_done: + os << "OK"; + break; + case Z_ExtendedServicesResponse_accepted: + os << "ACCEPT"; + break; + case Z_ExtendedServicesResponse_failure: + if (er->num_diagnostics) + os << "DIAG " << **(er->diagnostics); + else + os << "ERROR"; + break; + default: + os << "unknown"; + } + } + else + os << " -"; + } + } break; case Z_APDU_close: os << " " << "close" << " "; { - Z_Close *c - = zapdu.u.close; + Z_Close *c = zapdu.u.close; if (c) { if (c->closeReason) { os << *(c->closeReason) << " "; - switch (*(c->closeReason)) { + switch (*c->closeReason) + { case Z_Close_finished: os << "finished"; break; -- 1.7.10.4