src/shepp/SheppPrint.H

Go to the documentation of this file.
00001 /* ${copyright}$ */
00002 /* $Id: SheppPrint.H 581 2006-03-15 18:55:45Z eduardo $ */
00007 #ifndef __SHEPP_PRINT_H__
00008 #define __SHEPP_PRINT_H__
00009 
00010 #include "CommonData.H"
00011 
00013 class SheppPrint {
00014 public:
00015   //used by both domain and contact
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   //used by domain only
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   //used by contact only
00048 
00050 
00053   static void postal_info(CommonData::PostalInfo postal)
00054   {
00055     printf("  PostalInfo:\n");
00056     printf("    type: [%s]\n", postal.type.c_str());
00057 
00058     if (postal.name != "") {
00059       printf("    name: [%s]\n", postal.name.c_str());
00060     }
00061     if (postal.org != "") {
00062       printf("    org : [%s]\n", postal.org.c_str());
00063     }
00064 
00065     if (postal.str1 != "") {
00066       printf("    str1: [%s]\n", postal.str1.c_str());
00067     }
00068     if (postal.str2 != "") {
00069       printf("    str2: [%s]\n", postal.str2.c_str());
00070     }
00071     if (postal.str3 != "") {
00072       printf("    str3: [%s]\n", postal.str3.c_str());
00073     }
00074 
00075     if (postal.city != "") {
00076       printf("    city: [%s]\n", postal.city.c_str());
00077     }
00078 
00079     if (postal.sp != "") {
00080       printf("    s/p : [%s]\n", postal.sp.c_str());
00081     }
00082 
00083     if (postal.pc != "") {
00084       printf("    pc  : [%s]\n", postal.pc.c_str());
00085     }
00086 
00087     if (postal.cc != "") {
00088       printf("    cc  : [%s]\n", postal.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 [ ");
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__

Generated on Wed Mar 22 14:18:27 2006 for libepp_nicbr by  doxygen 1.4.6