Fesapi  2.0.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
EpcDocument.h
1 /*-----------------------------------------------------------------------
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"; you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -----------------------------------------------------------------------*/
19 #pragma once
20 
21 #include <string>
22 #include <vector>
23 #include <limits>
24 #include <stdexcept>
25 
26 #include "../epc/Package.h"
27 
28 #include "DataObjectRepository.h"
29 #include "DataFeeder.h"
30 
31 namespace COMMON_NS
32 {
34  class EpcDocument : public DataFeeder
35  {
36  public:
37 
43  DLL_IMPORT_OR_EXPORT EpcDocument(const std::string & fileName);
44 
46  DLL_IMPORT_OR_EXPORT virtual ~EpcDocument();
47 
57  DLL_IMPORT_OR_EXPORT void open(const std::string & fileName);
58 
60  DLL_IMPORT_OR_EXPORT void close();
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 unsigned int 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* partialObj) const;
146 
147  private :
148  static const char * DOCUMENT_EXTENSION;
149 
150  void deserializeRelFiles(DataObjectRepository & repo);
151 
153  epc::Package* package;
155  std::string filePath;
156  };
157 }
An abstract data object.
Definition: AbstractObject.h:31
This abstract class acts as a buffer between the RESQML (business) classes and the persisted data.
Definition: DataObjectRepository.h:164
openingMode
Definition: DataObjectRepository.h:182
This class allows an access to a memory package representing an EPC document.
Definition: EpcDocument.h:35
void open(const std::string &fileName)
std::string getExtendedCoreProperty(const std::string &key)
EpcDocument(const std::string &fileName)
std::string getName() const
void setFilePath(const std::string &fp)
unsigned int getExtendedCorePropertyCount() const
virtual std::string deserializeInto(DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
void serializeFrom(const DataObjectRepository &repo, bool useZip64=false)
void setExtendedCoreProperty(const std::string &key, const std::string &value)
virtual ~EpcDocument()
std::string deserializePartiallyInto(DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
std::string getStorageDirectory() const
std::unordered_map< std::string, std::string > & getExtendedCoreProperty()
Definition: Package.h:36