rtems_base64

  1# This file was automatically generated by SWIG (https://www.swig.org).
  2# Version 4.2.1
  3#
  4# Do not make changes to this file unless you know what you are doing - modify
  5# the SWIG interface file instead.
  6
  7from sys import version_info as _swig_python_version_info
  8from mock_rtems import _rtems_base64 as _rtems_base64
  9
 10try:
 11    import builtins as __builtin__
 12except ImportError:
 13    import __builtin__
 14
 15def _swig_repr(self):
 16    try:
 17        strthis = "proxy of " + self.this.__repr__()
 18    except __builtin__.Exception:
 19        strthis = ""
 20    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
 21
 22
 23def _swig_setattr_nondynamic_instance_variable(set):
 24    def set_instance_attr(self, name, value):
 25        if name == "this":
 26            set(self, name, value)
 27        elif name == "thisown":
 28            self.this.own(value)
 29        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
 30            set(self, name, value)
 31        else:
 32            raise AttributeError("You cannot add instance attributes to %s" % self)
 33    return set_instance_attr
 34
 35
 36def _swig_setattr_nondynamic_class_variable(set):
 37    def set_class_attr(cls, name, value):
 38        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
 39            set(cls, name, value)
 40        else:
 41            raise AttributeError("You cannot add class attributes to %s" % cls)
 42    return set_class_attr
 43
 44
 45def _swig_add_metaclass(metaclass):
 46    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
 47    def wrapper(cls):
 48        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
 49    return wrapper
 50
 51
 52class _SwigNonDynamicMeta(type):
 53    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
 54    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
 55
 56
 57
 58def _Base64_Encode(put_char, arg, src, len, wordbreak, wordlen):
 59    r"""
 60    Outputs the source buffer in base64 encoding.
 61
 62    After word length of output characters produced by the encoding a word break
 63    is produced.
 64
 65    :type put_char: IO_Put_char
 66    :param put_char: is the put character function used to output the encoded
 67          source buffer.
 68
 69    :type arg: void
 70    :param arg: is the argument passed to the put character function.
 71
 72    :type src: void
 73    :param src: is the pointer to the source buffer begin.
 74
 75    :param srclen: is the length of the source buffer in bytes.
 76
 77    :type wordbreak: string
 78    :param wordbreak: is the word break string.
 79
 80    :type wordlen: int
 81    :param wordlen: is the word length in bytes.  If the word length is less than
 82          four, then a word length of four will be used.
 83
 84    :rtype: int
 85    :return: Returns the count of output characters.
 86    """
 87    return _rtems_base64._Base64_Encode(put_char, arg, src, len, wordbreak, wordlen)
 88
 89def _Base64url_Encode(put_char, arg, src, len, wordbreak, wordlen):
 90    r"""
 91    Outputs the source buffer in base64url encoding.
 92
 93    After word length of output characters produced by the encoding a word break
 94    is produced.
 95
 96    :type put_char: IO_Put_char
 97    :param put_char: is the put character function used to output the encoded
 98          source buffer.
 99
100    :type arg: void
101    :param arg: is the argument passed to the put character function.
102
103    :type src: void
104    :param src: is the pointer to the source buffer begin.
105
106    :param srclen: is the length of the source buffer in bytes.
107
108    :type wordbreak: string
109    :param wordbreak: is the word break string.
110
111    :type wordlen: int
112    :param wordlen: is the word length in bytes.  If the word length is less than
113          four, then a word length of four will be used.
114
115    :rtype: int
116    :return: Returns the count of output characters.
117    """
118    return _rtems_base64._Base64url_Encode(put_char, arg, src, len, wordbreak, wordlen)
119BASE64_DECODE_STATE_0 = _rtems_base64.BASE64_DECODE_STATE_0
120
121BASE64_DECODE_STATE_1 = _rtems_base64.BASE64_DECODE_STATE_1
122
123BASE64_DECODE_STATE_2 = _rtems_base64.BASE64_DECODE_STATE_2
124
125BASE64_DECODE_STATE_3 = _rtems_base64.BASE64_DECODE_STATE_3
126
127class Base64_Decode_control(object):
128    r"""Contains the base64 and base64url decoder control."""
129
130    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
131    __repr__ = _swig_repr
132    state = property(_rtems_base64.Base64_Decode_control_state_get, _rtems_base64.Base64_Decode_control_state_set, doc=r"""state : Base64_Decode_state""")
133    target = property(_rtems_base64.Base64_Decode_control_target_get, _rtems_base64.Base64_Decode_control_target_set, doc=r"""target : p.uint8_t""")
134    target_end = property(_rtems_base64.Base64_Decode_control_target_end_get, _rtems_base64.Base64_Decode_control_target_end_set, doc=r"""target_end : p.q(const).uint8_t""")
135
136    def __init__(self):
137        r"""__init__(Base64_Decode_control self) -> Base64_Decode_control"""
138        _rtems_base64.Base64_Decode_control_swiginit(self, _rtems_base64.new_Base64_Decode_control())
139    __swig_destroy__ = _rtems_base64.delete_Base64_Decode_control
140
141# Register Base64_Decode_control in _rtems_base64:
142_rtems_base64.Base64_Decode_control_swigregister(Base64_Decode_control)
143cvar = _rtems_base64.cvar
144_Base64_Encoding = cvar._Base64_Encoding
145_Base64url_Encoding = cvar._Base64url_Encoding
146
147
148def _Base64_Decode_initialize(_self, target, target_size):
149    r"""
150    Initializes the base64 decoder.
151
152    :type self: :py:class:`Base64_Decode_control`, out
153    :param self: is the base64 decoder control to initialize.
154
155    :type target: uint8_t, out
156    :param target: is the base address of the target area for decoding.
157
158    :type target_size: int
159    :param target_size: is the size in bytes of the target area for decoding.
160    """
161    return _rtems_base64._Base64_Decode_initialize(_self, target, target_size)
162BASE64_DECODE_SUCCESS = _rtems_base64.BASE64_DECODE_SUCCESS
163
164BASE64_DECODE_OVERFLOW = _rtems_base64.BASE64_DECODE_OVERFLOW
165
166BASE64_DECODE_INVALID_INPUT = _rtems_base64.BASE64_DECODE_INVALID_INPUT
167
168
169def _Base64_Decode(_self, ch):
170    r"""
171    Decodes the character.
172
173    The decoder accepts base64 and base64url encodings.  White space is ignored.
174
175    :param out]: self is the base64 decoder control.
176
177    :type ch: char
178    :param ch: is the character to decode.
179    """
180    return _rtems_base64._Base64_Decode(_self, ch)
181
182_Base64_Decoding = cvar._Base64_Decoding
BASE64_DECODE_STATE_0 = See C documentation
BASE64_DECODE_STATE_1 = See C documentation
BASE64_DECODE_STATE_2 = See C documentation
BASE64_DECODE_STATE_3 = See C documentation
class Base64_Decode_control:
128class Base64_Decode_control(object):
129    r"""Contains the base64 and base64url decoder control."""
130
131    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
132    __repr__ = _swig_repr
133    state = property(_rtems_base64.Base64_Decode_control_state_get, _rtems_base64.Base64_Decode_control_state_set, doc=r"""state : Base64_Decode_state""")
134    target = property(_rtems_base64.Base64_Decode_control_target_get, _rtems_base64.Base64_Decode_control_target_set, doc=r"""target : p.uint8_t""")
135    target_end = property(_rtems_base64.Base64_Decode_control_target_end_get, _rtems_base64.Base64_Decode_control_target_end_set, doc=r"""target_end : p.q(const).uint8_t""")
136
137    def __init__(self):
138        r"""__init__(Base64_Decode_control self) -> Base64_Decode_control"""
139        _rtems_base64.Base64_Decode_control_swiginit(self, _rtems_base64.new_Base64_Decode_control())
140    __swig_destroy__ = _rtems_base64.delete_Base64_Decode_control

Contains the base64 and base64url decoder control.

Base64_Decode_control()
137    def __init__(self):
138        r"""__init__(Base64_Decode_control self) -> Base64_Decode_control"""
139        _rtems_base64.Base64_Decode_control_swiginit(self, _rtems_base64.new_Base64_Decode_control())

__init__(Base64_Decode_control self) -> Base64_Decode_control

thisown
131    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

The membership flag

state
target
target_end
cvar = See C documentation
BASE64_DECODE_SUCCESS = See C documentation
BASE64_DECODE_OVERFLOW = See C documentation
BASE64_DECODE_INVALID_INPUT = See C documentation