Fesapi 2.9.0.1
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{
31 class EpcDocument : public DataFeeder
32 {
33 public:
34
40 DLL_IMPORT_OR_EXPORT EpcDocument(const std::string & fileName) { open(fileName); }
41
43 DLL_IMPORT_OR_EXPORT ~EpcDocument() { close(); }
44
54 DLL_IMPORT_OR_EXPORT void open(const std::string & fileName);
55
57 DLL_IMPORT_OR_EXPORT void close() {
58 package.reset();
59 filePath = "";
60 }
61
71 DLL_IMPORT_OR_EXPORT void setFilePath(const std::string & fp);
72
80 DLL_IMPORT_OR_EXPORT void serializeFrom(const DataObjectRepository & repo, bool useZip64 = false);
81
91 DLL_IMPORT_OR_EXPORT virtual std::string deserializeInto(DataObjectRepository & repo, DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY);
92
97 DLL_IMPORT_OR_EXPORT std::string deserializePartiallyInto(DataObjectRepository & repo, DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY);
98
104 DLL_IMPORT_OR_EXPORT std::string getStorageDirectory() const;
105
111 DLL_IMPORT_OR_EXPORT std::string getName() const;
112
118 DLL_IMPORT_OR_EXPORT std::unordered_map< std::string, std::string > & getExtendedCoreProperty();
119
126 DLL_IMPORT_OR_EXPORT void setExtendedCoreProperty(const std::string & key, const std::string & value);
127
133 DLL_IMPORT_OR_EXPORT uint64_t getExtendedCorePropertyCount() const;
134
143 DLL_IMPORT_OR_EXPORT std::string getExtendedCoreProperty(const std::string & key);
144
145 DLL_IMPORT_OR_EXPORT std::string resolvePartial(AbstractObject const * partialObj) const;
146
147 private :
148 static constexpr char const* DOCUMENT_EXTENSION = ".epc";
149
150 void deserializeRelFiles(DataObjectRepository & repo);
151
153 std::unique_ptr<epc::Package> package;
155 std::string filePath;
156 };
157}
An abstract data object.
Definition AbstractObject.h:33
This abstract class acts as a buffer between the RESQML (business) classes and the persisted data.
Definition DataObjectRepository.h:167
openingMode
Definition DataObjectRepository.h:185
This class allows an access to a memory package representing an EPC document.
Definition EpcDocument.h:32
void open(const std::string &fileName)
std::string getExtendedCoreProperty(const std::string &key)
EpcDocument(const std::string &fileName)
Definition EpcDocument.h:40
std::string getName() const
void setFilePath(const std::string &fp)
virtual std::string deserializeInto(DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
~EpcDocument()
Definition EpcDocument.h:43
void serializeFrom(const DataObjectRepository &repo, bool useZip64=false)
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:57