Fesapi 2.3.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Relationship.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under the License.
18-----------------------------------------------------------------------*/
19#ifndef RELATIONSHIP_H
20#define RELATIONSHIP_H
21
22#include <string>
23
24namespace epc
25{
28 {
29 private:
34 bool internalTarget;
36 std::string target;
38 std::string type;
39
44 std::string id;
45
46 public:
47
53 Relationship(const bool & internalTarget = true);
54
63 Relationship(const std::string & rsTarget, const std::string & rsType,const std::string & rsId, const bool & internalTarget = true);
65 ~Relationship() = default;
66
72 std::string toString() const;
73
79 bool isInternalTarget() const;
80
86 const std::string& getTarget() const;
87
93 const std::string& getType() const;
94
100 const std::string& getId() const;
101
106
112 void setTarget(const std::string & rsTarget);
113
119 void setType(const std::string & rsType);
120
122 void setDestinationObjectType() {type = "http://schemas.energistics.org/package/2012/relationships/destinationObject";}
124 void setSourceObjectType() {type = "http://schemas.energistics.org/package/2012/relationships/sourceObject";}
126 void setDestinationMediaType() {type = "http://schemas.energistics.org/package/2012/relationships/destinationMedia";}
128 void setSourceMediaType() {type = "http://schemas.energistics.org/package/2012/relationships/sourceMedia";}
130 void setChunkedPartType() {type = "http://schemas.energistics.org/package/2012/relationships/chunkedPart";}
132 void setExternalPartProxyToMlType() {type = "http://schemas.energistics.org/package/2012/relationships/externalPartProxyToMl";}
134 void setMlToExternalPartProxyType() {type = "http://schemas.energistics.org/package/2012/relationships/mlToExternalPartProxy";}
136 void setExternalResourceType() {type = "http://schemas.energistics.org/package/2012/relationships/externalResource";}
137
143 void setId(const std::string & rsId);
144 };
145
154 bool operator==(const Relationship& r1, const Relationship& r2);
155}
156
157#endif
Definition: Relationship.h:28
void setIsExternalTarget()
void setId(const std::string &rsId)
void setType(const std::string &rsType)
Relationship(const bool &internalTarget=true)
Relationship(const std::string &rsTarget, const std::string &rsType, const std::string &rsId, const bool &internalTarget=true)
const std::string & getType() const
void setDestinationMediaType()
Definition: Relationship.h:126
void setSourceObjectType()
Definition: Relationship.h:124
bool isInternalTarget() const
void setExternalPartProxyToMlType()
Definition: Relationship.h:132
void setTarget(const std::string &rsTarget)
void setChunkedPartType()
Definition: Relationship.h:130
void setDestinationObjectType()
Definition: Relationship.h:122
void setMlToExternalPartProxyType()
Definition: Relationship.h:134
std::string toString() const
void setExternalResourceType()
Definition: Relationship.h:136
~Relationship()=default
const std::string & getTarget() const
void setIsInternalTarget()
const std::string & getId() const
void setSourceMediaType()
Definition: Relationship.h:128
The epc namespace.
Definition: ContentType.h:25
bool operator==(const Relationship &r1, const Relationship &r2)