00001
00002
00007 #ifndef __SHEPP_PRINT_H__
00008 #define __SHEPP_PRINT_H__
00009
00010 #include "CommonData.H"
00011
00013 class SheppPrint {
00014 public:
00015
00016
00018
00021 static void authInfo(AuthInfo auth) {
00022 if (auth.get_pw() != "") {
00023 printf(" authInfo pw: [%s]\n", auth.get_pw().c_str());
00024 if (auth.get_roid() != "") {
00025 printf(" roid: [%s]\n", auth.get_roid().c_str());
00026 }
00027 }
00028 }
00029
00030
00031
00033
00036 static void nameserver(NameServer ns)
00037 {
00038 printf(" nameserver %s\n", ns.name.c_str());
00039
00040 set<NSIPAddr>::const_iterator it;
00041 set<NSIPAddr> ips = ns.ips;
00042 for (it = ips.begin(); it != ips.end(); it++) {
00043 printf(" %s: %s\n", (*it).version.c_str(), (*it).addr.c_str());
00044 }
00045 }
00046
00047
00048
00050
00053 static void postal_info(PostalInfo postal)
00054 {
00055 printf(" PostalInfo:\n");
00056 printf(" type: [%s]\n", postal.get_type().c_str());
00057
00058 if (postal.get_name() != "") {
00059 printf(" name: [%s]\n", postal.get_name().c_str());
00060 }
00061 if (postal.get_org() != "") {
00062 printf(" org : [%s]\n", postal.get_org().c_str());
00063 }
00064
00065 if (postal.get_str1() != "") {
00066 printf(" str1: [%s]\n", postal.get_str1().c_str());
00067 }
00068 if (postal.get_str2() != "") {
00069 printf(" str2: [%s]\n", postal.get_str2().c_str());
00070 }
00071 if (postal.get_str3() != "") {
00072 printf(" str3: [%s]\n", postal.get_str3().c_str());
00073 }
00074
00075 if (postal.get_city() != "") {
00076 printf(" city: [%s]\n", postal.get_city().c_str());
00077 }
00078
00079 if (postal.get_sp() != "") {
00080 printf(" s/p : [%s]\n", postal.get_sp().c_str());
00081 }
00082
00083 if (postal.get_pc() != "") {
00084 printf(" pc : [%s]\n", postal.get_pc().c_str());
00085 }
00086
00087 if (postal.get_cc() != "") {
00088 printf(" cc : [%s]\n", postal.get_cc().c_str());
00089 }
00090 }
00091
00093
00096 static void phone(CommonData::Phone phone)
00097 {
00098 printf(" number: [%s] ext: [%s]\n", phone.number.c_str(),
00099 phone.ext.c_str());
00100 }
00101
00103
00106 static void disclose(CommonData::Disclose disclose)
00107 {
00108 printf(" disclose (flag=%d) [ ", disclose.flag);
00109 if (disclose.name_int) {
00110 printf("name_int ");
00111 }
00112 if (disclose.name_loc) {
00113 printf("name_loc ");
00114 }
00115 if (disclose.org_int) {
00116 printf("org_int ");
00117 }
00118 if (disclose.org_loc) {
00119 printf("org_loc ");
00120 }
00121 if (disclose.addr_int) {
00122 printf("addr_int ");
00123 }
00124 if (disclose.addr_loc) {
00125 printf("addr_loc ");
00126 }
00127 if (disclose.voice) {
00128 printf("voice ");
00129 }
00130 if (disclose.fax) {
00131 printf("fax ");
00132 }
00133 if (disclose.email) {
00134 printf("email ");
00135 }
00136 printf("]\n");
00137 }
00138 };
00139
00140 #endif //__SHEPP_PRINT_H__