ExtUti...:String(3pm)
π
ExtUtils::Typemaps::STL::String β the 3pm manual, bestie edition π
okay so this page lives in the User Contributed Perl Documentation section (3pm) of the manual, and it's literally all about ExtUtils::Typemaps::STL::String π¦ β no cap, that's the whole vibe.
β¨ NAME β¨
ExtUtils::Typemaps::STL::String β a whole set of typemaps for STL std::strings, periodt π
πΈ 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');
like, read your own maps, merge these in, write it out β the whole glow-up in three steps β¨
π¦ DESCRIPTION π¦
ExtUtils::Typemaps::STL::String is an ExtUtils::Typemaps subclass (yes, a subclass, main character energy π) that hands you a set of mappings for C++ STL strings. These are them, exactly, no edits:
TYPEMAP
std::string T_STD_STRING
std::string* T_STD_STRING_PTR
INPUT
T_STD_STRING
$var = std::string( SvPV_nolen( $arg ), SvCUR( $arg ) );
T_STD_STRING_PTR
$var = new std::string( SvPV_nolen( $arg ), SvCUR( $arg ) );
OUTPUT
T_STD_STRING
$arg = newSVpvn( $var.c_str(), $var.length() );
T_STD_STRING_PTR
$arg = newSVpvn( $var->c_str(), $var->length() );
like β TYPEMAP says what maps to what, INPUT converts incoming Perl scalars into std::strings (the pointer one news it, obvs), and OUTPUT turns them back into SV's with newSVpvn. it's giving symmetry π
π§ METHODS π§
these are the overridden methods, iykyk:
β new
creates a new ExtUtils::Typemaps::STL::String object π it acts like any other ExtUtils::Typemaps object, except β plot twist β it already has the string type maps initialized. so you don't gotta do a thing, it just comes pre-loaded β¨
π SEE ALSO π
ExtUtils::TypemapsExtUtils::Typemaps::DefaultExtUtils::Typemaps::ObjectMap
go read those too, they're the supporting cast π«Ά
π AUTHOR π
Steffen Mueller <smueller@cpan.org> β we stan π«‘
π COPYRIGHT AND LICENSE π
Copyright 2010, 2011, 2012, 2013 by Steffen Mueller
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
fr fr read the license before you go redistributing, bestie π it's the same terms as Perl itself, so keep it cute and keep it legal π
okay that's the whole page!! no notes β¨ this was perl v5.36.0, dated 2022-10-21, filed under ExtUti...:String(3pm) on the man shelf β mwah, slay, bye π
π
π¦ where this page comes from
- ubuntu noble: libextutils-typemaps-default-perl 1.05-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libextutils-typemaps-default-perl 1.05-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libextutils-typemaps-default-perl 1.05-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms