DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
thread_safe_ole_storage.h
1 /*********************************************************************************************************************************************/
2 /* DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. */
3 /* Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, */
4 /* document analysis. Offline processing possible for security and confidentiality */
5 /* */
6 /* Copyright (c) SILVERCODERS Ltd, http://silvercoders.com */
7 /* Project homepage: https://github.com/docwire/docwire */
8 /* */
9 /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_THREAD_SAFE_OLE_STORAGE_H
13 #define DOCWIRE_THREAD_SAFE_OLE_STORAGE_H
14 
15 #include "core_export.h"
16 #include "pimpl.h"
17 #include <span>
18 #include <string>
19 #include <vector>
20 #include "wv2/src/olestorage.h"
21 
22 namespace docwire
23 {
24 
25 class thread_safe_ole_stream_reader;
26 using namespace wvWare;
27 
28 class DOCWIRE_CORE_EXPORT thread_safe_ole_storage : public OLEStorage, public with_pimpl<thread_safe_ole_storage>
29 {
30  public:
31  explicit thread_safe_ole_storage(const std::string& file_name);
32  thread_safe_ole_storage(std::span<const std::byte> buffer);
33  bool isValid() const override;
34  bool open(Mode mode) override;
35  void close() override;
36  std::string name() const override;
37  std::string getLastError();
38  bool getStreamsAndStoragesList(std::vector<std::string>& components);
39  bool enterDirectory(const std::string& directory_path);
40  bool leaveDirectory();
41  bool readDirectFromBuffer(unsigned char* buffer, int size, int offset) override;
42  OLEStreamReader* createStreamReader(const std::string& stream_path) override;
43  private:
44  void streamDestroyed(OLEStream* stream) override;
45 };
46 
47 } // namespace docwire
48 
49 #endif // DOCWIRE_THREAD_SAFE_OLE_STORAGE_H
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19