File size: 900 Bytes
2c3c408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
#include <pybind11/pytypes.h>
#include <pybind11/stl.h>

#include <exception>

#define TILEDB_DEPRECATED
#define TILEDB_DEPRECATED_EXPORT

#include "../util.h"
#include <tiledb/tiledb> // C++

#if !defined(NDEBUG)
// #include "debug.cc"
#endif

namespace tiledbpy {

using namespace std;
using namespace tiledb;
namespace py = pybind11;
using namespace pybind11::literals;

class PyASCIIMetadataTest {

public:
  static void write_ascii(py::str uri) {
    Context ctx;
    Array array(ctx, uri, TILEDB_WRITE);

    std::string st = "xyz";
    array.put_metadata("abc", TILEDB_STRING_ASCII, st.length(), st.c_str());

    array.close();
  }
};

void init_test_metadata(py::module &m) {
  py::class_<PyASCIIMetadataTest>(m, "metadata_test_aux")
      .def_static("write_ascii", &PyASCIIMetadataTest::write_ascii);
}

}; // namespace tiledbpy