1 /******************************************************************
\r
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
19 ******************************************************************/
\r
22 * @file Definitions.cpp
\r
24 * @brief This file provides data Model for Json Schema Definitions.
\r
27 #include "Definitions.h"
\r
31 std::string Definitions::getName() const
\r
36 void Definitions::setName(const std::string &name)
\r
41 std::string Definitions::getType() const
\r
46 void Definitions::setType(const std::string &type)
\r
51 std::vector<std::string> const &Definitions::getRequiredValues() const
\r
56 void Definitions::setRequiredValue(const std::string &reqValue)
\r
58 auto it = m_required.begin();
\r
59 for (; it != m_required.end(); ++it)
\r
61 if (*it == reqValue)
\r
64 if (m_required.end() == it)
\r
66 m_required.push_back(reqValue);
\r
70 PropertiesPtr Definitions::getproperty(const std::string &propName )
\r
72 if (m_properties.end() != m_properties.find(propName))
\r
74 return m_properties[propName];
\r
79 std::map<std::string, PropertiesPtr> const &Definitions::getProperties()
\r
81 return m_properties;
\r
84 void Definitions::addProperty(const std::string &propName, const PropertiesPtr &property)
\r
86 if (m_properties.end() == m_properties.find(propName))
\r
88 m_properties[propName] = property;
\r