Mercurial > pytave
annotate oct-py-types.h @ 339:832ee1f14862
doc: document functions in oct-py-types.h
* oct-py-types.h: Add doxygen documentation strings.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Mon, 15 Aug 2016 21:53:25 -0700 |
parents | d3d355dc44ad |
children | 06b8aeea456f |
rev | line source |
---|---|
320
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
1 /* |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
2 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
3 Copyright (C) 2016 Mike Miller |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
4 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
5 This file is part of Pytave. |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
6 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
7 Pytave is free software; you can redistribute it and/or modify it |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
10 option) any later version. |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
11 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
12 Pytave is distributed in the hope that it will be useful, but WITHOUT |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
15 for more details. |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
16 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
18 along with Pytave; see the file COPYING. If not, see |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
20 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
21 */ |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
22 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
23 #if ! defined (pytave_oct_py_types_h) |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
24 #define pytave_oct_py_types_h 1 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
25 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
26 #include <Python.h> |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
27 #include <complex> |
325
fd5881d48238
Overhaul Python string creation and extraction
Mike Miller <mtmiller@octave.org>
parents:
320
diff
changeset
|
28 #include <string> |
320
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
29 |
336
c081e30c2f64
Overhaul Python list creation from cell array
Mike Miller <mtmiller@octave.org>
parents:
328
diff
changeset
|
30 class Cell; |
320
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
31 class octave_scalar_map; |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
32 class octave_value; |
320
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
33 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
34 namespace pytave |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
35 { |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
36 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
37 //! Create a Python bool object with the value of the given @c bool value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
38 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
39 //! @param value @c true or @c false value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
40 //! @return Python bool object |
320
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
41 PyObject * |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
42 make_py_bool (bool value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
43 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
44 //! Create a Python complex object with the value of the given @c complex value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
45 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
46 //! @param value complex value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
47 //! @return Python complex object |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
48 PyObject * |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
49 make_py_complex (std::complex<double> value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
50 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
51 //! Create a Python float object with the value of the given @c double value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
52 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
53 //! @param value floating point value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
54 //! @return Python float object |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
55 PyObject * |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
56 make_py_float (double value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
57 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
58 //! Create a Python dict object from the given Octave scalar map value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
59 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
60 //! The values contained in the map are recursively converted to appropriate |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
61 //! Python values. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
62 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
63 //! @param map Octave scalar map |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
64 //! @return Python dict object |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
65 PyObject * |
320
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
66 make_py_dict (const octave_scalar_map& map); |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
67 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
68 //! Extract the integer value of the given Python int or long object. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
69 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
70 //! @param obj Python int or long object |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
71 //! @return integer value of @a obj |
328
5782d7932529
Automatically convert Python 2 'int' type to Octave int64 (fixes issue #56)
Mike Miller <mtmiller@octave.org>
parents:
325
diff
changeset
|
72 int64_t |
5782d7932529
Automatically convert Python 2 'int' type to Octave int64 (fixes issue #56)
Mike Miller <mtmiller@octave.org>
parents:
325
diff
changeset
|
73 extract_py_int64 (PyObject *obj); |
5782d7932529
Automatically convert Python 2 'int' type to Octave int64 (fixes issue #56)
Mike Miller <mtmiller@octave.org>
parents:
325
diff
changeset
|
74 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
75 //! Create a Python int object with the value of the given @c int32_t value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
76 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
77 //! @param value integer value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
78 //! @return Python int or long object |
336
c081e30c2f64
Overhaul Python list creation from cell array
Mike Miller <mtmiller@octave.org>
parents:
328
diff
changeset
|
79 PyObject * |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
80 make_py_int (int32_t value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
81 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
82 //! Create a Python int object with the value of the given @c uint32_t value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
83 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
84 //! @param value integer value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
85 //! @return Python int or long object |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
86 PyObject * |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
87 make_py_int (uint32_t value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
88 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
89 //! Create a Python int object with the value of the given @c int64_t value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
90 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
91 //! @param value integer value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
92 //! @return Python int or long object |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
93 PyObject * |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
94 make_py_int (int64_t value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
95 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
96 //! Create a Python int object with the value of the given @c uint64_t value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
97 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
98 //! @param value integer value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
99 //! @return Python int or long object |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
100 PyObject * |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
101 make_py_int (uint64_t value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
102 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
103 //! Create a Python list object from the given Octave cell array value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
104 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
105 //! The values contained in the cell array are recursively converted to |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
106 //! appropriate Python values. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
107 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
108 //! @param cell Octave cell array |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
109 //! @return Python list object |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
110 PyObject * |
336
c081e30c2f64
Overhaul Python list creation from cell array
Mike Miller <mtmiller@octave.org>
parents:
328
diff
changeset
|
111 make_py_list (const Cell& cell); |
c081e30c2f64
Overhaul Python list creation from cell array
Mike Miller <mtmiller@octave.org>
parents:
328
diff
changeset
|
112 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
113 //! Create a Python numeric object from the given Octave numeric or boolean |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
114 //! scalar value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
115 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
116 //! The following implicit type conversions are implemented by this function: |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
117 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
118 //! @arg @c bool from Octave logical scalar, |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
119 //! @arg @c complex from Octave double or single precision complex scalar, |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
120 //! @arg @c float from Octave double or single precision scalar, |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
121 //! @arg @c int from any Octave integer-valued scalar, |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
122 //! @arg @c long from any Octave @c uint32, @c int64, or @c uint64, and only |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
123 //! if running against Python 2. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
124 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
125 //! @param value Octave numeric or boolean scalar value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
126 //! @return Python numeric object (@c bool, @c int, @c long, @c float, or |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
127 //! @c complex) |
337
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
128 PyObject * |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
129 make_py_numeric_value (const octave_value& value); |
d3d355dc44ad
Overhaul Python numeric type creation from Octave scalar types
Mike Miller <mtmiller@octave.org>
parents:
336
diff
changeset
|
130 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
131 //! Extract the string value of the given Python str, bytes, or unicode object. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
132 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
133 //! @param obj Python str, bytes, or unicode object |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
134 //! @return string value of @a obj |
325
fd5881d48238
Overhaul Python string creation and extraction
Mike Miller <mtmiller@octave.org>
parents:
320
diff
changeset
|
135 std::string |
fd5881d48238
Overhaul Python string creation and extraction
Mike Miller <mtmiller@octave.org>
parents:
320
diff
changeset
|
136 extract_py_str (PyObject *obj); |
fd5881d48238
Overhaul Python string creation and extraction
Mike Miller <mtmiller@octave.org>
parents:
320
diff
changeset
|
137 |
339
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
138 //! Create a Python str object from the given @c string value. |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
139 //! |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
140 //! @param str string value |
832ee1f14862
doc: document functions in oct-py-types.h
Mike Miller <mtmiller@octave.org>
parents:
337
diff
changeset
|
141 //! @return Python str object |
325
fd5881d48238
Overhaul Python string creation and extraction
Mike Miller <mtmiller@octave.org>
parents:
320
diff
changeset
|
142 PyObject * |
fd5881d48238
Overhaul Python string creation and extraction
Mike Miller <mtmiller@octave.org>
parents:
320
diff
changeset
|
143 make_py_str (const std::string& str); |
fd5881d48238
Overhaul Python string creation and extraction
Mike Miller <mtmiller@octave.org>
parents:
320
diff
changeset
|
144 |
320
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
145 } |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
146 |
c2aa34730dc9
Convert scalar struct into Python dict (fixes issue #57)
Mike Miller <mtmiller@octave.org>
parents:
diff
changeset
|
147 #endif |