Fesapi 2.10.1.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() { close(); }
51
61 DLL_IMPORT_OR_EXPORT void open(const std::string & fileName);
62
64 DLL_IMPORT_OR_EXPORT void close() {
65 package.reset();
66 filePath = "";
67 }
68
78 DLL_IMPORT_OR_EXPORT void setFilePath(const std::string & fp);
79
86 DLL_IMPORT_OR_EXPORT void serializeFrom(DataObjectRepository& repo, bool useZip64 = false);
87
97 DLL_IMPORT_OR_EXPORT virtual std::string deserializeInto(DataObjectRepository& repo, DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY);
98
103 DLL_IMPORT_OR_EXPORT std::string deserializePartiallyInto(DataObjectRepository& repo, DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY);
104
110 DLL_IMPORT_OR_EXPORT std::string getStorageDirectory() const;
111
117 DLL_IMPORT_OR_EXPORT std::string getName() const;
118
124 DLL_IMPORT_OR_EXPORT std::unordered_map< std::string, std::string > & getExtendedCoreProperty();
125
132 DLL_IMPORT_OR_EXPORT void setExtendedCoreProperty(const std::string & key, const std::string & value);
133
139 DLL_IMPORT_OR_EXPORT uint64_t getExtendedCorePropertyCount() const;
140
149 DLL_IMPORT_OR_EXPORT std::string getExtendedCoreProperty(const std::string & key);
150
151 DLL_IMPORT_OR_EXPORT std::string resolvePartial(AbstractObject const * partialObj) const;
152
153 private :
154 static constexpr char const* DOCUMENT_EXTENSION = ".epc";
155
156 void deserializeRelFiles(DataObjectRepository & repo);
157
159 std::unique_ptr<epc::Package> package;
161 std::string filePath;
162 };
163}
An abstract data object.
Definition AbstractObject.h:33
A DataObjectRepository stores in memory all dataObjects. This is the in-memory container which holds ...
Definition DataObjectRepository.h:171
openingMode
Definition DataObjectRepository.h:190
EPC is an implementation of the Open Packaging Conventions (OPC), a widely used container-file techno...
Definition EpcDocument.h:39
void open(const std::string &fileName)
std::string getExtendedCoreProperty(const std::string &key)
EpcDocument(const std::string &fileName)
Definition EpcDocument.h:47
std::string getName() const
void setFilePath(const std::string &fp)
void serializeFrom(DataObjectRepository &repo, bool useZip64=false)
virtual std::string deserializeInto(DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
~EpcDocument()
Definition EpcDocument.h:50
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
void close()
Definition EpcDocument.h:64