belcard_identification.hpp 2.56 KB
Newer Older
Sylvain Berfini's avatar
Sylvain Berfini committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
#ifndef belcard_identification_hpp
#define belcard_identification_hpp

#include "belcard.hpp"

#include <string>
#include <list>
#include <map>
#include <memory>

using namespace::std;

namespace belcard {
	class BelCardFN : public BelCardProperty {
	public:
		static shared_ptr<BelCardFN> create() {
			return make_shared<BelCardFN>();
		}
		
		BelCardFN() : BelCardProperty() {
			setName("FN");
		}
		
		virtual void addParam(const shared_ptr<BelCardParam> &param) {
			BelCardProperty::addParam(param);
		}
	};
	
	class BelCardN : public BelCardProperty {
	private:
		string _family_name;
		string _given_name;
		string _additional_name;
		string _prefixes;
		string _suffixes;
	public:
		static shared_ptr<BelCardN> create() {
			return make_shared<BelCardN>();
		}
		
		BelCardN() : BelCardProperty() {
			setName("N");
		}
		
		virtual void setFamilyName(const string &value) {
			_family_name = value;
			setValue(_family_name + ";" + _given_name + ";" + _additional_name + ";" + _prefixes + ";" + _suffixes);
		}
		virtual const string &getFamilyName() const {
			return _family_name;
		}
		
		virtual void setGivenName(const string &value) {
			_given_name = value;
			setValue(_family_name + ";" + _given_name + ";" + _additional_name + ";" + _prefixes + ";" + _suffixes);
		}
		virtual const string &getGivenName() const {
			return _given_name;
		}
		
		virtual void setAdditionalName(const string &value) {
			_additional_name = value;
			setValue(_family_name + ";" + _given_name + ";" + _additional_name + ";" + _prefixes + ";" + _suffixes);
		}
		virtual const string &getAdditionalName() const {
			return _additional_name;
		}
		
		virtual void setPrefixes(const string &value) {
			_prefixes = value;
			setValue(_family_name + ";" + _given_name + ";" + _additional_name + ";" + _prefixes + ";" + _suffixes);
		}
		virtual const string &getPrefixes() const {
			return _prefixes;
		}
		
		virtual void setSuffixes(const string &value) {
			_suffixes = value;
			setValue(_family_name + ";" + _given_name + ";" + _additional_name + ";" + _prefixes + ";" + _suffixes);
		}
		virtual const string &getSuffixes() const {
			return _suffixes;
		}
		
		virtual void addParam(const shared_ptr<BelCardParam> &param) {
			BelCardProperty::addParam(param);
		}
	};
	
	class BelCardNickname : public BelCardProperty {
	public:
		static shared_ptr<BelCardNickname> create() {
			return make_shared<BelCardNickname>();
		}
		
		BelCardNickname() : BelCardProperty() {
			setName("NICKNAME");
		}
		
		virtual void addParam(const shared_ptr<BelCardParam> &param) {
			BelCardProperty::addParam(param);
		}
	};
}

#endif