CxxWrap.CxxWrapCore.SmartPointer
— TypeBase class for smart pointers
CxxWrap.CxxWrapCore.gcprotect
— MethodProtect a variable from garbage collection by adding it to the global array kept by CxxWrap
CxxWrap.CxxWrapCore.gcunprotect
— MethodUnprotect a variable from garbage collection by removing it from the global array kept by CxxWrap
CxxWrap.CxxWrapCore.ptrunion
— MethodCreate a Union containing the type and a smart pointer to any type derived from it
CxxWrap.CxxWrapCore.@initcxx
— Macro@initcxx
Initialize the C++ pointer tables in a precompiled module using CxxWrap. Must be called from within __init__
in the wrapped module
CxxWrap.CxxWrapCore.@readmodule
— Macro@readmodule libraryfile_cb [functionname]
Read a C++ module and associate it with the Julia module enclosing the macro call. libraryfile_cb
is a function that returns the shared library file to load as a string. In case of a JLL exporting libfoo.so
it is possible to use foo_jll.get_libfoo_path()
CxxWrap.CxxWrapCore.@wrapfunctions
— Macro@wrapfunctions
Wrap the functions defined in the C++ side of the enclosing module. Requires that @readmodule
and @wraptypes
was called first.
CxxWrap.CxxWrapCore.@wrapmodule
— Macro@wrapmodule libraryfile_cb [functionname]
Place the functions and types from the C++ lib into the module enclosing this macro call Calls an entry point named define_julia_module
, unless another name is specified as the second argument.
libraryfile_cb
is a function that returns the shared library file to load as a string. In case of a JLL exporting libfoo.so
it is possible to use foo_jll.get_libfoo_path()
CxxWrap.CxxWrapCore.@wraptypes
— Macro@wraptypes
Wrap the types defined in the C++ side of the enclosing module. Requires that @readmodule
was called first.
CxxWrap.StdLib.StdString
— MethodStdString(str, n::Integer)
Create a StdString
from the first n
code units of str
(including null-characters).
Examples
julia> StdString("visible\0hidden", 10)
"visible\0hi"
CxxWrap.StdLib.StdString
— MethodStdString(str::String)
Create a StdString
from the contents of the string. Any null-characters ('\0') will be included in the string such that ncodeunits(str) == ncodeunits(StdString(str))
.
CxxWrap.StdLib.StdString
— MethodStdString(str::Union{Cstring, Base.CodeUnits, Vector{UInt8}, Ref{Int8}, Array{Int8}})
Create a StdString
from the null-terminated character sequence.
If you want to construct a StdString
that includes the null-character ('\0') either use StdString(::String)
or StdString(::Any, ::Int)
.
Examples
julia> StdString(b"visible\0hidden")
"visible"