Changeset View
Changeset View
Standalone View
Standalone View
find-modules/module_generation/PyKF5/KCodecs.py
- This file was added.
1 | # | ||||
---|---|---|---|---|---|
2 | # Copyright 2017 by Shaheed Haque (srhaque@theiet.org) | ||||
3 | # | ||||
4 | # This program is free software; you can redistribute it and/or modify | ||||
5 | # it under the terms of the GNU General Public License as published by | ||||
6 | # the Free Software Foundation; either version 2 of the License, or | ||||
7 | # (at your option) any later version. | ||||
8 | # | ||||
9 | # This program is distributed in the hope that it will be useful, | ||||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | # GNU General Public License for more details. | ||||
13 | # | ||||
14 | # You should have received a copy of the GNU General Public License | ||||
15 | # along with this program; if not, write to the Free Software | ||||
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||||
17 | # 02110-1301 USA. | ||||
18 | # | ||||
19 | """ | ||||
20 | SIP binding customisation for PyKF5.KCodecs. This modules describes: | ||||
21 | | ||||
22 | * Supplementary SIP file generator rules. | ||||
23 | """ | ||||
24 | | ||||
25 | import rule_helpers | ||||
26 | | ||||
27 | def _mark_abstract(container, sip, matcher): | ||||
28 | sip["annotations"].add("Abstract") | ||||
29 | | ||||
30 | | ||||
31 | def container_rules(): | ||||
32 | return [ | ||||
33 | ["KCodecs", ".*", ".*", ".*", ".*", _mark_abstract], | ||||
34 | ] | ||||
35 | | ||||
36 | | ||||
37 | def function_rules(): | ||||
38 | return [ | ||||
39 | ["KCodecs::Codec", "encode", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
40 | ["KCodecs::Codec", "decode", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
41 | | ||||
42 | ["KCodecs::Encoder", "encode", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
43 | ["KCodecs::Encoder", "finish", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
44 | ["KCodecs::Encoder", "write", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
45 | ["KCodecs::Encoder", "writeCRLF", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
46 | ["KCodecs::Encoder", "flushOutputBuffer", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
47 | | ||||
48 | ["KCodecs::Decoder", "decode", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
49 | ["KCodecs::Decoder", "finish", ".*", ".*", ".*char.*&.*", rule_helpers.function_discard], | ||||
50 | | ||||
51 | ["KCharsets", "codecForName", ".*", ".*", ".*name", rule_helpers.function_discard], | ||||
52 | ["KCharsets", "fromEntity", ".*", ".*", ".*str", rule_helpers.function_discard], | ||||
53 | ] |