Fesapi 2.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
EpcDocument.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#pragma once
20
21#include <string>
22
23#include "../epc/Package.h"
24
25#include "DataObjectRepository.h"
26#include "DataFeeder.h"
27
28namespace COMMON_NS
29{
38 class EpcDocument : public DataFeeder
39 {
40 public:
41
47 DLL_IMPORT_OR_EXPORT EpcDocument(const std::string& fileName) { open(fileName); }
48
50 DLL_IMPORT_OR_EXPORT ~EpcDocument() = default;
51
57 DLL_IMPORT_OR_EXPORT void open(const std::string& fileName)
58 {
59 setFilePath(fileName);
60 package.reset(new epc::Package());
61 }
62
68 DLL_IMPORT_OR_EXPORT void serializeFrom(DataObjectRepository& repo);
69
79 DLL_IMPORT_OR_EXPORT virtual std::string deserializeInto(DataObjectRepository& repo, DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY);
80
85 DLL_IMPORT_OR_EXPORT std::string deserializePartiallyInto(DataObjectRepository& repo, DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY);
86
92 DLL_IMPORT_OR_EXPORT std::string getStorageDirectory() const;
93
99 DLL_IMPORT_OR_EXPORT std::string getName() const;
100
107 DLL_IMPORT_OR_EXPORT std::unordered_map< std::string, std::string >& getExtendedCoreProperty();
108
115 DLL_IMPORT_OR_EXPORT void setExtendedCoreProperty(const std::string& key, const std::string& value);
116
123 DLL_IMPORT_OR_EXPORT uint64_t getExtendedCorePropertyCount() const;
124
134 DLL_IMPORT_OR_EXPORT std::string getExtendedCoreProperty(const std::string& key) const;
135
136 DLL_IMPORT_OR_EXPORT std::string resolvePartial(AbstractObject const* partialObj) const;
137
138 private :
148 void setFilePath(const std::string& fp);
149
150 void deserializeRelFiles(DataObjectRepository& repo);
151
152 static constexpr char const* DOCUMENT_EXTENSION = ".epc";
153
155 std::unique_ptr<epc::Package> package;
157 std::string filePath;
158 };
159}
An abstract data object is the super class of all FESAPI dataobjects which are contained in a DataObj...
Definition AbstractObject.h:35
Definition DataFeeder.h:31
A DataObjectRepository stores in memory all dataObjects. This is the in-memory container which holds ...
Definition DataObjectRepository.h:171
openingMode
Definition DataObjectRepository.h:190
~EpcDocument()=default
void open(const std::string &fileName)
Definition EpcDocument.h:57
EpcDocument(const std::string &fileName)
Definition EpcDocument.h:47
void serializeFrom(DataObjectRepository &repo)
std::string getName() const
std::string getExtendedCoreProperty(const std::string &key) const
virtual std::string deserializeInto(DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
std::string resolvePartial(AbstractObject const *partialObj) const
uint64_t getExtendedCorePropertyCount() const
void setExtendedCoreProperty(const std::string &key, const std::string &value)
std::string deserializePartiallyInto(DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
std::unordered_map< std::string, std::string > & getExtendedCoreProperty()
std::string getStorageDirectory() const
Definition Package.h:36