table of contents
other versions
- Tumbleweed 1.70.0-1.1
- Leap-15.6
| ExtUtils::Typemaps::STL::String(3pm) | User Contributed Perl Documentation | ExtUtils::Typemaps::STL::String(3pm) |
NAME¶
ExtUtils::Typemaps::STL::String - A set of typemaps for STL std::strings
SYNOPSIS¶
use ExtUtils::Typemaps::STL::String; # First, read my own type maps: my $private_map = ExtUtils::Typemaps->new(file => 'my.map'); # Then, get the object map set and merge it into my maps $private_map->merge(typemap => ExtUtils::Typemaps::STL::String->new); # Now, write the combined map to an output file $private_map->write(file => 'typemap');
DESCRIPTION¶
"ExtUtils::Typemaps::STL::String" is an "ExtUtils::Typemaps" subclass that provides a set of mappings for C++ STL strings. These are:
TYPEMAP
std::string T_STD_STRING
std::string* T_STD_STRING_PTR
INPUT
T_STD_STRING
{
size_t len;
const char * c = SvPV($arg, len);
$var = std::string(c, len);
}
T_STD_STRING_PTR
{
size_t len;
const char * c = SvPV($arg, len);
$var = new std::string(c, len);
}
OUTPUT
T_STD_STRING
$arg = newSVpvn( $var.c_str(), $var.length() );
T_STD_STRING_PTR
$arg = newSVpvn( $var->c_str(), $var->length() );
METHODS¶
These are the overridden methods:
new¶
Creates a new "ExtUtils::Typemaps::STL::String" object. It acts as any other "ExtUtils::Typemaps" object, except that it has the string type maps initialized.
SEE ALSO¶
ExtUtils::Typemaps, ExtUtils::Typemaps::Default, ExtUtils::Typemaps::ObjectMap
AUTHOR¶
Steffen Mueller <cpan@steffen-mueller.net>
COPYRIGHT AND LICENSE¶
Copyright 2010-2026 by Steffen Mueller
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 2026-10-10 | perl v5.44.0 |