-
Notifications
You must be signed in to change notification settings - Fork 21
/
vtkPersonInformation.h
107 lines (79 loc) · 3.44 KB
/
vtkPersonInformation.h
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
107
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
=========================================================================auto=*/
/// \brief vtkPersonInformation - specify name and other information
/// to identify a person.
///
#ifndef __vtkPersonInformation_h
#define __vtkPersonInformation_h
#include "vtkAddon.h"
#include <vtkObject.h>
#include <vtkStringArray.h>
#include <map>
class VTK_ADDON_EXPORT vtkPersonInformation : public vtkObject
{
public:
static vtkPersonInformation *New();
vtkTypeMacro(vtkPersonInformation,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent) override;
/* Explicitly deleted functions belong in the public interface */
vtkPersonInformation(const vtkPersonInformation&) = delete;
void operator=(const vtkPersonInformation&) = delete;
// Description:
// Set/Get username.
// Set method
virtual bool SetName(const std::string& value);
virtual std::string GetName();
virtual bool SetLogin(const std::string& value);
virtual std::string GetLogin();
virtual bool SetEmail(const std::string& value);
virtual std::string GetEmail();
virtual bool SetOrganization(const std::string& value);
virtual std::string GetOrganization();
virtual bool SetOrganizationRole(const std::string& value);
virtual std::string GetOrganizationRole();
virtual bool SetProcedureRole(const std::string& value);
virtual std::string GetProcedureRole();
// Description:
// Make a full, independent copy of another object into this object.
virtual void DeepCopy(vtkPersonInformation* source);
// Description:
// Set a custom string value. Calls Modified() if the value is different from the previous value.
// No validation is performed. If a standard string's key is used (Name, Email, ...)
// then the standard string is overwritten without validation.
// If value is set to empty then the key/value pair is deleted.
virtual void SetCustomString(const std::string& key, const std::string& value);
// Description:
// Get a custom string value.
// If a standard string's key is used (Name, Email, ...) then the corresponding value is returned.
// Empty string is returned if the key has no associated value.
virtual std::string GetCustomString(const std::string& key);
virtual bool IsEmailValid(const std::string& value);
// Description:
// Information keys.
static const char* KeyName() { return "Name"; };
static const char* KeyLogin() { return "Login"; };
static const char* KeyEmail() { return "Email"; };
static const char* KeyOrganization() { return "Organization"; };
static const char* KeyOrganizationRole() { return "OrganizationRole"; };
static const char* KeyProcedureRole() { return "ProcedureRole"; };
// Description:
// Write all key/value pairs to a string.
virtual std::string GetAsString();
// Description:
// Read all key/value pairs from a string.
// All previous values are cleared.
virtual bool SetFromString(const std::string& data);
// Description:
// Returns list of all keys.
virtual void GetKeys(vtkStringArray *keys);
protected:
vtkPersonInformation();
~vtkPersonInformation() override;
std::string EncodeString(const std::string& value);
std::string DecodeString(const std::string& value);
std::map<std::string, std::string> Data;
};
#endif