Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.io.base
Commits
3cd2d16e
There was a problem fetching the pipeline summary.
Commit
3cd2d16e
authored
7 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Updated API documentation
parent
75e62bb9
No related branches found
No related tags found
1 merge request
!21
Resolve "What is the use of PyBobIo_FilenameConverter"
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/c_cpp_api.rst
+15
-12
15 additions, 12 deletions
doc/c_cpp_api.rst
with
15 additions
and
12 deletions
doc/c_cpp_api.rst
+
15
−
12
View file @
3cd2d16e
...
...
@@ -69,24 +69,27 @@ Generic Functions
described above in case of success.
.. cpp:function:: int PyBobIo_FilenameConverter (PyObject* o,
PyObject
** b)
.. cpp:function:: int PyBobIo_FilenameConverter (PyObject* o,
const char
** b)
This function is meant to be used with :c:func:`PyArg_ParseTupleAndKeywords`
family of functions in the Python C-API. It converts an arbitrary input
object into a ``PyStringObject`` (in Python2.x) and into a ``PyBytesObject``
(in Python3.x). If the input object is of type ``PyUnicodeObject``, which is
the default in Python3.x, the unicode code is properly decoded using
:c:func:`PyUnicode_AsEncodedString` with ``encoding`` set to
``Py_FileSystemDefaultEncoding`` and ``errors`` set to ``"strict"``. On
versions of Python >= 3.2, this is just an alias for
:c:func:`PyUnicode_FSConverter`, which does a similar job.
Objects which are not ``PyUnicodeObject`` are coerced into a bytes/string
object using :c:func:`PyObject_Bytes` (on Python3.x) and
:c:func:`PyObject_Str` (on Python 2.x).
object into a ``const char*`` If the input object is of type
``PyUnicodeObject`` (which is the default in Python3.x) the unicode code is
properly decoded using :c:func:`PyUnicode_AsEncodedString` with ``encoding``
set to ``Py_FileSystemDefaultEncoding`` and ``errors`` set to ``"strict"``.
Objects which are not ``PyUnicodeObject`` are first coerced into a
bytes/string before converting to the ``const char*`` object using
:c:func:`PyObject_Bytes` (on Python3.x) and :c:func:`PyObject_Str`
(on Python 2.x).
Returns 0 if an error is detected, 1 on success.
.. note::
Since version 2.2, this function converts into ``const char*`` directly.
Before version 2.2, it was returning either ``PyBytesObject`` (Python 3)
or ``PyStringObject`` (Python 2).
Bob File Support
----------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment