OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
DocumentAPI.h
Go to the documentation of this file.
1#pragma once
2#include <iostream>
3#include <fstream>
4#include <sstream>
5#include <vector>
6#include <set>
7#include <bsoncxx/types/value.hpp>
8#include "bsoncxx/builder/basic/document.hpp"
9#include "bsoncxx/stdx/string_view.hpp"
10#include <string>
11
12using bsoncxx::types::value;
13using Document = bsoncxx::builder::basic::document;
14
15namespace DataStorageAPI
16{
18 {
19 public:
20 __declspec(dllexport) value InsertDocumentUsingGridFs(std::istream* source, std::string fileName);
21 __declspec(dllexport) void GetDocumentUsingGridFs(value id, std::ostream* destination);
22 __declspec(dllexport) value InsertDocumentUsingGridFs(bsoncxx::document::view docView, std::string fileName);
23 __declspec(dllexport) void GetDocumentUsingGridFs(value id, uint8_t *&buffer, size_t &length);
24 __declspec(dllexport) value InsertDocumentUsingGridFs(bsoncxx::document::view docView, std::string fileName, Document &metaDoc);
25 __declspec(dllexport) void GetDocumentUsingGridFs(value id, uint8_t *&buffer, size_t &length, std::string fileName);
26
27 /*
28 __declspec(dllexport) value InsertDocumentToFileStorage(std::ifstream* source, std::string fileName);
29 __declspec(dllexport) void GetDocumentFromFileStorage(value id, std::ifstream* destination);
30 __declspec(dllexport) std::string GetDocumentPathFromFileStorage(value id);
31
32 __declspec(dllexport) value InsertDocumentToDatabase(std::string fileName, std::string content);
33 __declspec(dllexport) std::string GetDocumentFromDatabase(value id);
34
35 __declspec(dllexport) value InsertDocumentPathToDatabase(std::string filePath, std::string fileName);
36 __declspec(dllexport) std::string GetDocumentPathFromDatabase(value id);*/
37 private:
38 __declspec(dllexport) std::vector<std::string_view> insertElementsToMetadata(bsoncxx::document::view docView, Document &metaDoc);
39 __declspec(dllexport) size_t getSizeOfElement(bsoncxx::document::element element);
40 };
41};
bsoncxx::builder::basic::document Document
Definition DocumentManager.h:14
bsoncxx::types::value value
Definition DocumentManager.h:16
Definition DocumentAPI.h:18
__declspec(dllexport) value InsertDocumentUsingGridFs(bsoncxx uint8_t size_t std::string fileName
Definition DocumentAPI.h:25
__declspec(dllexport) value InsertDocumentUsingGridFs(bsoncxx uint8_t *& buffer
Definition DocumentAPI.h:23
__declspec(dllexport) value InsertDocumentUsingGridFs(std std::ostream * destination
Definition DocumentAPI.h:21
__declspec(dllexport) value InsertDocumentUsingGridFs(bsoncxx __declspec(dllexport) void GetDocumentUsingGridFs(value id
__declspec(dllexport) value InsertDocumentUsingGridFs(std __declspec(dllexport) void GetDocumentUsingGridFs(value id
__declspec(dllexport) value InsertDocumentUsingGridFs(bsoncxx uint8_t size_t & length
Definition DocumentAPI.h:23
Definition ArrayBinaryConverter.h:3