1 /*
2  * Copyright (C) 2006-2021 Registro.br. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  * 1. Redistribution of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
16  * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
19  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
21  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
23  * DAMAGE.
24  */
25 /* $Id$ */
26 
27 #include "config.h"
28 
29 #include "CommonData.H"
30 
31 LIBEPP_NICBR_NS_BEGIN
32 
set_id(const string & id)33 void CommonData::set_id(const string &id)
34 {
35 	_id = id;
36 }
37 
insert_postal_info(const PostalInfo & postal_info)38 void CommonData::insert_postal_info(const PostalInfo &postal_info)
39 {
40 	_postal_info.push_back(postal_info);
41 }
42 
set_voice(const Phone & voice)43 void CommonData::set_voice(const Phone &voice)
44 {
45 	_voice = voice;
46 	_voice_f = true;
47 }
48 
set_fax(const Phone & fax)49 void CommonData::set_fax(const Phone &fax)
50 {
51 	_fax = fax;
52 	_fax_f = true;
53 }
54 
set_email(const string & email)55 void CommonData::set_email(const string &email)
56 {
57 	_email = email;
58 	_email_f = true;
59 }
60 
set_disclose(const Disclose & disclose)61 void CommonData::set_disclose(const Disclose &disclose)
62 {
63 	_disclose = disclose;
64 }
65 
get_id() const66 string CommonData::get_id() const
67 {
68 	return _id;
69 }
70 
get_postal_info() const71 vector<PostalInfo> CommonData::get_postal_info() const
72 {
73 	return _postal_info;
74 }
75 
get_voice() const76 CommonData::Phone CommonData::get_voice() const
77 {
78 	return _voice;
79 }
80 
get_fax() const81 CommonData::Phone CommonData::get_fax() const
82 {
83 	return _fax;
84 }
85 
get_email() const86 string CommonData::get_email() const
87 {
88 	return _email;
89 }
90 
get_disclose() const91 CommonData::Disclose CommonData::get_disclose() const
92 {
93 	return _disclose;
94 }
95 
reset()96 void CommonData::reset()
97 {
98 	_id = "";
99 
100 	_postal_info.clear();
101 
102 	_voice.ext = "";
103 	_voice.number = "";
104 	_voice_f = false;
105 
106 	_fax.ext = "";
107 	_fax.number = "";
108 	_fax_f = false;
109 
110 	_email = "";
111 	_email_f = false;
112 
113 	_disclose.flag = -1;
114 	_disclose.name_int = false;
115 	_disclose.name_loc = false;
116 	_disclose.org_int = false;
117 	_disclose.org_loc = false;
118 	_disclose.addr_int = false;
119 	_disclose.addr_loc = false;
120 	_disclose.voice = false;
121 	_disclose.fax = false;
122 	_disclose. email = false;
123 }
124 
125 LIBEPP_NICBR_NS_END
126