HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //usr/share/swig4.0/php/std_string_view.i
/* -----------------------------------------------------------------------------
 * std_string_view.i
 *
 * SWIG typemaps for std::string_view types
 * ----------------------------------------------------------------------------- */

%include <exception.i>

%{
#include <string_view>
%}

namespace std {

    %naturalvar string_view;

    class string_view;

    %typemap(typecheck,precedence=SWIG_TYPECHECK_STRINGVIEW) string_view, const string_view& %{
        $1 = (Z_TYPE($input) == IS_STRING) ? 1 : 0;
    %}

    %typemap(in, phptype="string") string_view %{
        convert_to_string(&$input);
        $1 = std::string_view(Z_STRVAL($input), Z_STRLEN($input));
    %}

    %typemap(in, phptype="string") const string_view& ($*1_ltype temp) %{
        convert_to_string(&$input);
        temp = std::string_view(Z_STRVAL($input), Z_STRLEN($input));
        $1 = &temp;
    %}

    %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) string_view %{
        convert_to_string($input);
        $result = std::string_view(Z_STRVAL_P($input), Z_STRLEN_P($input));
    %}

    %typemap(out, phptype="string") string_view %{
        ZVAL_STRINGL($result, $1.data(), $1.size());
    %}

    %typemap(directorin) string_view, const string_view& %{
        ZVAL_STRINGL($input, $1.data(), $1.size());
    %}

    %typemap(out, phptype="string") const string_view& %{
        ZVAL_STRINGL($result, $1->data(), $1->size());
    %}

    %typemap(throws) string_view, const string_view& %{
        {
            zval swig_exception;
            ZVAL_STRINGL(&swig_exception, $1.data(), $1.size());
            zend_throw_exception_object(&swig_exception);
            goto fail;
        }
    %}

    %typemap(throws) string_view*, const string_view* %{
        {
            zval swig_exception;
            ZVAL_STRINGL(&swig_exception, $1->data(), $1->size());
            zend_throw_exception_object(&swig_exception);
            goto fail;
        }
    %}

}