New macro added to the family of %interface macros. This new macro
is for adding additional interfaces for the generated interface to
extend/derive from.
Closes#1188
* char_binary_java_fix-tidyup:
Move SWIGStringWithLengthHelper to csharphead.swg
cdata whitespace/cosmetic fixups
cdata doc updates
Rename `typemaps/cdata_struct.swg` to `typemaps/cdata_begin.swg`. And `typemaps/cdata.swg` to `typemaps/cdata.swg`. Move `cdata_apply.swg` content to `typemaps/cdata.swg`.
Group the C# marshalling of STRING-LENGTH typemap into C# class named SWIGStringWithLengthHelper.
Leave Length & string reverse order typemap in typemaps/strings.swg
Support old C# as "LPUTF8Str" was add in 2017.
Improve documentation. Follow @wsfulton reviews.
Use a dummy for MzScheme and untested OCaml cdate. To prevent compilation error.
Further fixing follow reviews.
Reorganise raw data typemap, so typemaps folder contain only common part. Improve document.
Inline SWIG_string_to_utf8_bytes SWIG_utf8_bytes_to_string code
Fixes of STRING/BYTES LENGTH typemaps.
Conflicts:
CHANGES.current
The cdata.i docs in C#, Java, D, Go had a confusing mix of target language
and C declarations. Improve the main cdata documentation in Library.html instead.
Fix Java STRING LENGTH typemap.
Use string type in static typed languages (Java, C#, D and Go).
Add BYTES LENGTH typemap and apply it for binary data.
Use byte type in static typed languages.
Add li_cdata_cpp, li_cdata and char_binary
tests for most of languages(apart from R and experimental).
Fix the director_binary_string test and add it to C#, D, Go,
Perl, PHP, Python, Ruby and octave.
Update documents.
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
[C#] Support nullable reference types. A generic C# option to the
%module directive allows one to add in any code at the beginning of every
C# file. This can add the #nullable enable preprocessor directive at the beginning
of every C# file in order to enable nullable reference types as follows:
%module(csbegin="#nullable enable\n") mymodule
Closes#2681
[D, Java] Add the dbegin option to the %module directive for generating code at
the beginning of every D file. Similarly javabegin for Java. This enables one
to add a common comment at the start of each D/Java file.
in the %array_functions and %array_class macros.
Affects C#, D, Go, Guile, Java, Javascript, Lua, Ocaml, R, Racket.
Closes#1680
If the old types are required for backwards compatibility, use %apply to
restore the old types as follows:
%include "carrays.i"
%apply int { size_t nelements, size_t index }
... %array_functions and %array_class ...
%clear size_t nelements, size_t index; # To be safe in case used elsewhere
std::vector::capacity and std::vector::reserve signature changes.
Java api changes from:
public long capacity() { ... }
public void reserve(long n) { ... }
to:
public int capacity() { ... }
public void reserve(int n) { ... }
to fit in with the usual Java convention of using int for container
indexing and sizing.
The original api for std::vector::reserve can be also be made available via
%extend to add in an overloaded method as follows:
%include <std_vector.i>
%extend std::vector {
void reserve(jlong n) throw (std::length_error, std::out_of_range) {
if (n < 0)
throw std::out_of_range("vector reserve size must be positive");
self->reserve(n);
}
}
This change is partially driven by the need to seamlessly support the full
64-bit range for size_t generically, apart from the customisations for the
STL containers, by using:
%apply unsigned long long { size_t };
%apply const unsigned long long & { const size_t & };
Similarly for std::array::size.
Also enhance docs for applying unsigned long long typemaps for 64-bit
size_t.
Defining SWIGWORDSIZE64 now applies the (unsigned) long long
typemaps to (unsigned) long for a better match on systems
where long is 64-bits.
Although size_t typemaps are now applied from the int typemaps instead
of the long typemaps, identical code is generated and the mapping is
still to the Java signed long type.
Closes#646Closes#649
Running the test-suite as follows on a 64-bit long system:
env SWIG_FEATURES=-DSWIGWORDSIZE64 make check-java-test-suite
passes, except for a few tests which fail where they expect the
default Java type to be int or long instead of long or BigInteger
respectively.
Also arrays_java.i results in:
invalid conversion from ‘long int*’ to ‘long long int*’ [-fpermissive]
invalid conversion from ‘long int**’ to ‘long long int**’ [-fpermissive]
* imfunc:
Add special variable imfuncname expansion for C# and D
Test and document imfuncname special variable expansion
Update docs.
Also expose in proxyClassFunctionHandler
Expose to javaout typemaps.
Conflicts:
CHANGES.current
When C++ methods are not able to be overloaded in a derived class,
such as when they differ by just const, or the target language
parameters types are identical even when the C++ parameter types
are different, SWIG will ignore one of the overloaded methods with
a warning. A %ignore is required to explicitly ignore one of the
overloaded methods to avoid the warning message. Methods added
in the derived classes due to one of the %interface macros are now
similarly ignored/not added to the derived class.
The adding of additional methods into the parse tree is now more
robust and complete resulting in support for %feature and %rename
for the added methods.
Closes#1277
Add ability to change the modifiers for the C# and Java
interface generated when using the %interface macros.
For C# use the 'csinterfacemodifiers' typemap.
For Java use the 'javainterfacemodifiers' typemap.
For example:
%typemap(csinterfacemodifiers) X "internal interface"
Closes#1874
Added to the javadestruct, javadestruct_derived, ddispose, ddispose_derived
typemaps to mirror enhanced flexibility in the csdisposing and
csdisposing_derived (C#) typemaps. If provided the contents are generated
as the delete/dispose method's parameters declaration.
This is the Doxygen work begun in Google Summer of Code projects 2008
and 2012 and subsequently improved by numerous contributors.
* vadz-doxygen: (314 commits)
Add changes entry for Doxygen support
Add some missing doctype tyemaps
Doxygen warnings cleanup
Move doxygen warning numbers
Add Python doxygen example
Doxygen example
Add Doxygen to include paths
Doxygen source rename
More merge fixes from doxygen branches
Correct python example headers
Correct source code headers
Another merge fix from doxygen branches
Java enums output format fixes
Add omitted doxygen_parsing_enums testcase
PEP8 conformance for comment verifier module
Clean up merge problem
Doxygen html tweaks
Update html chapter numbering for added Doxygen chapter
Fixes to makechap.py to detect ill-formed headers
html fixes for Doxygen
Add missing CPlusPlus17.html file
Format files to unix format
Doxygen testcase tweak to match that in the html docs
Doxygen html documentation updates and corrections
Remove doxygen Examples subdirectory
Beautify doxygen source code
Code formatting fixes in doxygen code
Remove unused doxygen code
new_node refactor
Various merge fixes in doxygen branches
Unused variable warning fix
Fix wrongly resetting indent after formulae in Doxygen comments
Add support for doxygen:alias feature
Get rid of meaningless return type of DoxygenParser methods
Return enum, not untyped int, when classifying Doxygen commands
Get rid of unnecessary "typedef enum" in C++ code
Use slash, not backslash, in "C/C++" in the documentation
Replace literal "<" with "<" in HTML documentation
Fix broken link to java.sun.com in Doxygen documentation
Fix using com.sun.tools.javadoc package under macOS
Fix error reporting for special characters in Doxygen parsing code
Switch Python Doxygen unit tests to use inspect.getdoc()
Use correct separator in Java class path under Windows.
Remove executable permission from appveyor.yml.
Use JAVA_HOME value in configure to detect Java.
Display JAVA_HOME value in "make java_version".
Fix harmless MSVC warning in DoxygenTranslator code.
Reset "_last" for all but first enum elements.
Don't duplicate Javadoc from global enum Doxygen comments twice.
Move Doxygen comments concatenation from the parser to the lexer.
Fix shift/reduce conflicts in Doxygen pre/post comment parsing.
Rewrote part of the grammar dealing with Doxygen comments for enums.
No changes, just remove spurious white space only differences.
Move Doxygen comment mangling from the parser to the lexer.
Merge "-builtin" autodoc bugs workarounds from master into test.
Quote JAVA_HOME variable value in Java test suite makefile.
Remove unused C_COMMENT_STRING terminal from the grammar.
Fix missing returns in the Doxygen test suite code.
Fix trimming whitespace from Doxygen comments.
Remove code not doing anything from PyDocConverter.
Remove unused <sstream> header.
Remove unreferenced struct declaration.
Remove unused Swig_warn() function.
Remove any whitespace before ignored Doxygen commands.
Remove trailing space from one of Doxygen tests.
Fix autodoc strings generated in Python builtin case and the test.
Fix Doxygen unit test in Python "-builtin" case.
Use class docstrings in "-builtin" Python case.
Don't indent Doxygen doc strings in generated Python code.
Add a possibility to flexibly ignore custom Doxygen tags.
Stop completely ignoring many Doxygen comments.
Fix structural Doxygen comment recognition in the parser.
No changes, just make checking for Doxygen structural tags more sane.
Use "//", not "#", for comments in SWIG input.
Allow upper case letters and digits in Doxygen words.
Pass the node the Doxygen comment is attached to to DoxygenParser.
Get rid of findCommand() which duplicaed commandBelongs().
Recognize unknown Doxygen tags correctly.
No real changes, just pass original command to commandBelongs().
Describe Doxygen-specific %features in a single place.
Give warnings for unknown Doxygen commands in Doxygen parser.
Document the return type when translating Doxygen @return to Python.
Fix translated Doxygen comments for overloaded functions in Python.
Also merge Doxygen comments for overloaded constructors in Python.
Allow using enum elements as default values for Python functions.
Don't always use "*args" for all Python wrapper functions.
No real changes, just make PYTHON::check_kwargs() const.
Refactor: move makeParameterName() to common Language base class.
Remove long line wrapping from Python parameter list generation code.
Simplify and make more efficient building Python docstrings.
Translate Doxygen code blocks to Sphinx code blocks.
Add a simple test of multiple parameters to Doxygen test suite.
Make Python parameters types hyperlinks in the doc strings.
Make Language::classLookup() and enumLookup() static.
Fix arguments of @param, @return etc translations to Python.
Remove unused method from PyDocConverter.
No real changes, just remove an unnecessary variable.
Preserve relative indentation when parsing Doxygen comments.
Use Sphinx-friendly formatting for overloaded functions documentation.
Add poor man trailing white space detection to Doxygen Python tests.
...
Add support so that the %csmethodmodifiers, %dmethodmodifiers,
%javamethodmodifiers can modify the method modifiers for the destructor wrappers
in the proxy class: dispose, Dispose, delete. With this feature, it is now possible
to make a C# proxy class sealed, eg when wrapping a class X, the virtual method modifiers
can be removed using:
%typemap(csclassmodifiers) X "public sealed class"
%csmethodmodifiers X::~X "public /*virtual*/";