File: _Blob.cpp

package info (click to toggle)
pythonmagick 0.9.19-11.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,812 kB
  • sloc: sh: 4,363; cpp: 2,849; perl: 279; python: 175; makefile: 126
file content (49 lines) | stat: -rw-r--r-- 1,596 bytes parent folder | download | duplicates (5)
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
47
48
49

// Boost Includes ==============================================================
#include <boost/python.hpp>
#include <boost/cstdint.hpp>

// Includes ====================================================================
#include <Magick++/Blob.h>
#include "../helpers_src/Blob.h"

// Using =======================================================================
using namespace boost::python;

// Declarations ================================================================
namespace  {

BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Magick_Blob_updateNoCopy_overloads_2_3, updateNoCopy, 2, 3)


}// namespace 


// Module ======================================================================
void Export_pyste_src_Blob()
{
    scope* Magick_Blob_scope = new scope(
    class_< Magick::Blob >("Blob", init<  >())
        .def("__init__", &update_wrapper)
        .def(init< const Magick::Blob& >())
        .def("base64", (void (Magick::Blob::*)(const std::string) )&Magick::Blob::base64)
#if MagickLibVersion < 0x700
        .def("base64", (std::string (Magick::Blob::*)() )&Magick::Blob::base64)
#else
        .def("base64", (std::string (Magick::Blob::*)() const )&Magick::Blob::base64)
#endif
        .def("update", &update_wrapper)
        .def("updateNoCopy", &updateNoCopy_wrapper)
        .def("length", &Magick::Blob::length)
    );

    enum_< Magick::Blob::Allocator >("Allocator")
        .value("NewAllocator", Magick::Blob::NewAllocator)
        .value("MallocAllocator", Magick::Blob::MallocAllocator)
    ;

    delete Magick_Blob_scope;

    def("get_blob_data", &get_blob_data);
}