Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkStringProperty.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkStringProperty.h"
18 
19 const char *mitk::StringProperty::PATH = "path";
20 mitk::StringProperty::StringProperty(const char *string) : m_Value()
21 {
22  if (string)
23  m_Value = string;
24 }
25 
26 mitk::StringProperty::StringProperty(const std::string &s) : m_Value(s)
27 {
28 }
29 
30 mitk::StringProperty::StringProperty(const StringProperty &other) : BaseProperty(other), m_Value(other.m_Value)
31 {
32 }
33 
34 bool mitk::StringProperty::IsEqual(const BaseProperty &property) const
35 {
36  return this->m_Value == static_cast<const Self &>(property).m_Value;
37 }
38 
39 bool mitk::StringProperty::Assign(const BaseProperty &property)
40 {
41  this->m_Value = static_cast<const Self &>(property).m_Value;
42  return true;
43 }
44 
46 {
47  return m_Value;
48 }
49 
50 itk::LightObject::Pointer mitk::StringProperty::InternalClone() const
51 {
52  itk::LightObject::Pointer result(new Self(*this));
53  result->UnRegister();
54  return result;
55 }
virtual std::string GetValueAsString() const override
itk::SmartPointer< Self > Pointer
StringProperty(const char *string=nullptr)
Abstract base class for properties.
static const char * PATH
Property for strings.