Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
4dfa0a03
Commit
4dfa0a03
authored
Dec 04, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bindings: basic support for #if preprocessor directives
- #if 0 - #ifdef __OPENCV_BUILD
parent
eb44e0a5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
core_manual.hpp
modules/core/misc/java/src/cpp/core_manual.hpp
+2
-2
features2d_manual.hpp
modules/features2d/misc/java/src/cpp/features2d_manual.hpp
+1
-1
hdr_parser.py
modules/python/src2/hdr_parser.py
+25
-2
No files found.
modules/core/misc/java/src/cpp/core_manual.hpp
View file @
4dfa0a03
...
...
@@ -9,7 +9,7 @@ CV_EXPORTS_W void setErrorVerbosity(bool verbose);
}
#if
0
#if
def OPENCV_BINDINGS_PARSER
namespace
cv
{
...
...
@@ -30,4 +30,4 @@ CV_EXPORTS_W void min(InputArray src1, Scalar src2, OutputArray dst);
CV_EXPORTS_W
void
max
(
InputArray
src1
,
Scalar
src2
,
OutputArray
dst
);
}
#endif
//0
#endif
modules/features2d/misc/java/src/cpp/features2d_manual.hpp
View file @
4dfa0a03
...
...
@@ -294,7 +294,7 @@ private:
Ptr
<
DescriptorExtractor
>
wrapped
;
};
#if
0
#if
def OPENCV_BINDINGS_PARSER
//DO NOT REMOVE! The block is required for sources parser
enum
{
...
...
modules/python/src2/hdr_parser.py
View file @
4dfa0a03
...
...
@@ -793,6 +793,7 @@ class CppHeaderParser(object):
COMMENT
=
1
# inside a multi-line comment
DIRECTIVE
=
2
# inside a multi-line preprocessor directive
DOCSTRING
=
3
# inside a multi-line docstring
DIRECTIVE_IF_0
=
4
# inside a '#if 0' directive
state
=
SCAN
...
...
@@ -802,6 +803,8 @@ class CppHeaderParser(object):
self
.
lineno
=
0
self
.
wrap_mode
=
wmode
depth_if_0
=
0
for
l0
in
linelist
:
self
.
lineno
+=
1
#print(state, self.lineno, l0)
...
...
@@ -813,8 +816,28 @@ class CppHeaderParser(object):
# fall through to the if state == DIRECTIVE check
if
state
==
DIRECTIVE
:
if
not
l
.
endswith
(
"
\\
"
):
state
=
SCAN
if
l
.
endswith
(
"
\\
"
):
continue
state
=
SCAN
l
=
re
.
sub
(
r'//(.+)?'
,
''
,
l
)
.
strip
()
# drop // comment
if
l
==
'#if 0'
or
l
==
'#if defined(__OPENCV_BUILD)'
or
l
==
'#ifdef __OPENCV_BUILD'
:
state
=
DIRECTIVE_IF_0
depth_if_0
=
1
continue
if
state
==
DIRECTIVE_IF_0
:
if
l
.
startswith
(
'#'
):
l
=
l
[
1
:]
.
strip
()
if
l
.
startswith
(
"if"
):
depth_if_0
+=
1
continue
if
l
.
startswith
(
"endif"
):
depth_if_0
-=
1
if
depth_if_0
==
0
:
state
=
SCAN
else
:
# print('---- {:30s}:{:5d}: {}'.format(hname[-30:], self.lineno, l))
pass
continue
if
state
==
COMMENT
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment