aboutsummaryrefslogtreecommitdiffstats
path: root/util/memory/blob.pxd
blob: c68525024acc079708a09fe6be4225671bb8c000 (plain) (blame)
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
from libcpp cimport bool as bool_t

from util.generic.string cimport TString
from util.system.types cimport ui8


cdef extern from "util/memory/blob.h" nogil:
    cdef cppclass TBlob:
        TBlob()
        TBlob(const TBlob&)
        void Swap(TBlob& r)
        const void* Data() const
        size_t Size() const
        bool_t Empty() const
        bool_t IsNull() const
        const char* AsCharPtr() const
        const unsigned char* AsUnsignedCharPtr() const
        void Drop()
        TBlob SubBlob(size_t len) except +
        TBlob SubBlob(size_t begin, size_t end) except +
        TBlob DeepCopy() except +

        @staticmethod
        TBlob NoCopy(const void* data, size_t length) except +

        @staticmethod
        TBlob Copy(const void* data, size_t length) except +

        @staticmethod
        TBlob FromFile(const TString& path) except +

        @staticmethod
        TBlob PrechargedFromFile(const TString& path) except +

        @staticmethod
        TBlob FromString(const TString& s) except +

        ui8& operator[](size_t) const
        TBlob& operator=(TBlob&)