6 #ifndef __CONTACT_FUNCTIONS_H__
7 #define __CONTACT_FUNCTIONS_H__
25 if (error_msg !=
"") {
26 printf(
"error: %s\n", error_msg.c_str());
29 printf(
"contact command syntax help:\n");
32 if (specific ==
"" || specific ==
"check") {
33 printf(
" check <contact1> [contact2 ... contactN]\n");
36 if (specific ==
"" || specific ==
"info") {
37 printf(
" info <contact> [-auth authInfoPw]\n");
40 if (specific ==
"" || specific ==
"transfer") {
41 printf(
" transfer: <contact> [-auth authInfoPw]\n");
44 if (specific ==
"" || specific ==
"create") {
45 printf(
" create <contact>\n");
46 printf(
" [-postalInfo <type> <-name \"Contact Name\"> "
47 "[-org \"Org Name\"]\n");
48 printf(
" <-street1 \"address street/line 1\"> "
49 "[-street2 \"address number/line 2\"]\n");
50 printf(
" [-street3 \"address line 3\"] <-city \"City Name\"> "
51 "[-state \"State or Province\"]\n");
52 printf(
" [-pc \"postal code\"] <-cc country-code> ...]\n");
53 printf(
" [-voice number:ext] [-fax number:ext]\n");
54 printf(
" <-email emailAddr> [-auth authInfoPw]\n");
55 printf(
" [-disclose <flag> opt,opt,...] "
56 " [-password \"Password\"]\n"
57 " [-reminder \"Password reminder\"] [-language <lang>]\n");
59 printf(
" available values for opt:\n");
60 printf(
" {name_int name_loc org_int org_loc addr_int addr_loc "
61 "voice fax email}\n");
64 if (specific ==
"" || specific ==
"delete") {
65 printf(
" delete <contact>\n");
68 if (specific ==
"" || specific ==
"renew") {
69 printf(
" renew: not implemented\n");
72 if (specific ==
"" || specific ==
"update") {
73 printf(
" update <contact> [-add-status st1,...,stN] "
74 "[-rem-status st1,...,stN]\n");
75 printf(
" [-postalInfo <type> [-name \"Contact Name\"] "
76 "[-org \"Org Name\"]\n");
77 printf(
" [-street1 \"address street/line 1\"] "
78 "[-street2 \"address number/line 2\"]\n");
79 printf(
" [-street3 \"address line 3\"] [-city \"City Name\"] "
80 "[-state \"State or Province\"]\n");
81 printf(
" [-pc \"postal code\"] [-cc country-code] ...]\n");
82 printf(
" [-voice number:ext] [-fax number:ext]\n");
83 printf(
" [-email emailAddr] [-auth authInfoPw]\n");
84 printf(
" [-disclose <flag> opt,opt,...] "
85 " [-password \"Password\"]\n"
86 " [-reminder \"Password reminder\"] [-language <lang>]\n"
87 " [-add-property \"property\" ...] [-rem-property \"property\" ...]\n");
89 printf(
" available values for opt:\n");
90 printf(
" {name_int name_loc org_int org_loc addr_int addr_loc "
91 "voice fax email}\n");
95 if (error_msg !=
"") {
112 string cmd_name =
"check";
114 while (!args.empty()) {
116 args.erase(args.begin());
125 set<string>::const_iterator it;
126 printf(
"contacts to be checked:\n");
127 for (it = contacts.begin(); it != contacts.end(); it++) {
128 printf(
" [%s]\n", (*it).c_str());
148 string cmd_name =
"info";
155 args.erase(args.begin());
157 while (!args.empty()) {
158 if (args[0] ==
"-auth") {
178 printf(
"id to get info: [%s]\n", cmd->
get_id().c_str());
198 string cmd_name =
"transfer";
205 args.erase(args.begin());
207 while (!args.empty()) {
208 if (args[0] ==
"-auth") {
243 string cmd_name =
"create";
251 common_data.
set_id(args[0]);
252 args.erase(args.begin());
258 while (!args.empty()) {
259 if (args[0] ==
"-postalInfo") {
261 args.erase(args.begin());
271 for (
int i = 0; i < (int) postal_list.size(); i++) {
272 if (postal_list[i].get_type() == postal.get_type()) {
277 }
else if (args[0] ==
"-voice") {
279 args.erase(args.begin());
286 }
else if (args[0] ==
"-fax") {
288 args.erase(args.begin());
295 }
else if (args[0] ==
"-email") {
297 args.erase(args.begin());
302 args.erase(args.begin());
303 }
else if (args[0] ==
"-auth") {
316 }
else if (args[0] ==
"-disclose") {
318 args.erase(args.begin());
321 if (args[0] !=
"0" && args[0] !=
"1") {
324 disclose.flag = atoi(args[0].c_str());
325 args.erase(args.begin());
330 args.erase(args.begin());
333 }
else if (args[0] ==
"-password") {
335 args.erase(args.begin());
341 string password = args[0];
342 args.erase(args.begin());
350 }
else if (args[0] ==
"-reminder") {
352 args.erase(args.begin());
358 string reminder = args[0];
359 args.erase(args.begin());
367 }
else if (args[0] ==
"-language") {
369 args.erase(args.begin());
375 string language = args[0];
376 args.erase(args.begin());
420 vector<PostalInfo>::const_iterator it;
421 vector<PostalInfo> postal_list;
423 for (it = postal_list.begin(); it != postal_list.end(); it++) {
449 printf(
" password: [%s]\n", cmd->
get_password().c_str());
450 printf(
" reminder: [%s]\n", cmd->
get_reminder().c_str());
451 printf(
" language: [%s]\n", cmd->
get_language().c_str());
471 string cmd_name =
"delete";
478 args.erase(args.begin());
494 string cmd_name =
"renew";
507 string cmd_name =
"update";
515 common_data.
set_id(args[0]);
516 args.erase(args.begin());
518 while (!args.empty()) {
519 if (args[0] ==
"-add-status") {
521 args.erase(args.begin());
525 string tmp1 = args[0];
534 args.erase(args.begin());
535 }
else if (args[0] ==
"-rem-status") {
537 args.erase(args.begin());
541 string tmp1 = args[0];
550 args.erase(args.begin());
551 }
else if (args[0] ==
"-postalInfo") {
553 args.erase(args.begin());
563 for (
int i = 0; i < (int) postal_list.size(); i++) {
564 if (postal_list[i].get_type() == postal.get_type()) {
569 }
else if (args[0] ==
"-voice") {
571 args.erase(args.begin());
578 }
else if (args[0] ==
"-fax") {
580 args.erase(args.begin());
587 }
else if (args[0] ==
"-email") {
589 args.erase(args.begin());
594 args.erase(args.begin());
595 }
else if (args[0] ==
"-auth") {
608 }
else if (args[0] ==
"-disclose") {
610 args.erase(args.begin());
613 if (args[0] !=
"0" && args[0] !=
"1") {
616 disclose.flag = atoi(args[0].c_str());
617 args.erase(args.begin());
622 args.erase(args.begin());
625 }
else if (args[0] ==
"-password") {
627 args.erase(args.begin());
633 string password = args[0];
634 args.erase(args.begin());
642 }
else if (args[0] ==
"-reminder") {
644 args.erase(args.begin());
650 string reminder = args[0];
651 args.erase(args.begin());
659 }
else if (args[0] ==
"-language") {
661 args.erase(args.begin());
667 string language = args[0];
668 args.erase(args.begin());
676 }
else if (args[0] ==
"-add-property") {
678 args.erase(args.begin());
684 string property = args[0];
685 args.erase(args.begin());
693 }
else if (args[0] ==
"-rem-property") {
695 args.erase(args.begin());
701 string property = args[0];
702 args.erase(args.begin());
720 common_data.
get_fax().number ==
"" &&
738 set<string>::const_iterator st_it;
739 if (!status.empty()) {
740 printf(
" status to add: [ ");
741 for (st_it = status.begin(); st_it != status.end(); st_it++) {
742 printf(
"%s ", (*st_it).c_str());
748 if (!status.empty()) {
749 printf(
" status to rem: [ ");
750 for (st_it = status.begin(); st_it != status.end(); st_it++) {
751 printf(
"%s ", (*st_it).c_str());
756 vector<PostalInfo>::const_iterator it;
757 vector<PostalInfo> postal_list;
759 for (it = postal_list.begin(); it != postal_list.end(); it++) {
786 printf(
" password: [%s]\n", cmd->
get_password().c_str());
790 printf(
" reminder: [%s]\n", cmd->
get_reminder().c_str());
794 printf(
" language: [%s]\n", cmd->
get_language().c_str());
798 for (
int i = 0; i < propertiesAdd.size(); i++) {
799 printf(
" property to add: [%s]\n", propertiesAdd[i].c_str());
803 for (
int i = 0; i < propertiesRem.size(); i++) {
804 printf(
" property to rem: [%s]\n", propertiesRem[i].c_str());
823 if (!args.empty() && !(args[0] ==
"help")) {
824 if (args[0] ==
"check") {
825 args.erase(args.begin());
827 }
else if (args[0] ==
"info") {
828 args.erase(args.begin());
830 }
else if (args[0] ==
"transfer") {
831 args.erase(args.begin());
833 }
else if (args[0] ==
"create") {
834 args.erase(args.begin());
836 }
else if (args[0] ==
"delete") {
837 args.erase(args.begin());
839 }
else if (args[0] ==
"renew") {
840 args.erase(args.begin());
842 }
else if (args[0] ==
"update") {
843 args.erase(args.begin());
853 #endif //__CONTACT_FUNCTIONS_H__
static int split(string input, string &first, string &second, string splitter, bool relaxed=false)
Definition: SheppStrUtil.H:120
void set_id(const string &id)
Sets the object's id.
bool get_email_f() const
Returns the object's email change flag.
Definition: CommonData.H:623
string get_email() const
Returns the object's email.
Disclose get_disclose() const
Returns the object's disclosure policy.
void set_disclose(const Disclose &disclose)
Sets the object's disclosure policy.
bool get_fax_f() const
Returns the object's fax change flag.
Definition: CommonData.H:608
void set_email(const string &email)
Sets the object's email.
static void authInfo(AuthInfo auth)
prints an AuthInfo object
Definition: SheppPrint.H:21
static int phone(CommonData::Phone &phone, vector< string > &words)
fills a Phone based on input command line
Definition: SheppObjSet.H:546
PostalInfo class.
Definition: CommonData.H:281
void set_fax(const Phone &fax)
Sets the object's fax number.
void insert_postal_info(const PostalInfo &postal_info)
Inserts postal information into the object.
Phone get_fax() const
Returns the object's fax number.
void set_voice(const Phone &voice)
Sets the object's voice telephone number.
static void postal_info(PostalInfo postal)
prints a PostalInfo object
Definition: SheppPrint.H:53
bool get_roid_f() const
Returns the roid change flag.
Definition: CommonData.H:121
int process_action(Action &act)
Send and EPP Action.
Definition: SheppCommandFunctions.H:871
Definition: CommonData.H:491
vector< PostalInfo > get_postal_info() const
Returns the object's postal information.
static void disclose(CommonData::Disclose disclose)
prints a Disclose object
Definition: SheppPrint.H:106
static int postalInfo(PostalInfo &postal, vector< string > &words, string &error_msg, bool relaxed)
fills a PostalInfo based on input command line
Definition: SheppObjSet.H:357
EPP CommonData Class.
Definition: CommonData.H:487
Phone get_voice() const
Returns the object's voice telephone number.
string get_pw() const
Returns the password.
Definition: CommonData.H:140
bool get_voice_f() const
Returns the object's voice change flag.
Definition: CommonData.H:593
EPP command-line shell client command functions include file.
static int disclose(CommonData::Disclose &disclose, string word)
fills a Disclose based on input command line
Definition: SheppObjSet.H:563
Definition: CommonData.H:524
static int quote_gathering(vector< string > &words, string &gather)
Gathers command-line arguments bounded by quotes in a string.
Definition: SheppStrUtil.H:152
string get_id() const
Returns the object's id.
static int authInfo(AuthInfo &auth, vector< string > &words)
fills an AuthInfo based on input command line
Definition: SheppObjSet.H:54
static void phone(CommonData::Phone phone)
prints a Phone object
Definition: SheppPrint.H:96
AuthInfo Class.
Definition: CommonData.H:83