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/csharp/std_string_view.i
/* -----------------------------------------------------------------------------
 * std_string_view.i
 *
 * Typemaps for std::string_view and const std::string_view&
 * These are mapped to a C# String and are passed around by value.
 *
 * To use non-const std::string_view references use the following %apply.  Note
 * that they are passed by value.
 * %apply const std::string_view & {std::string_view &};
 * ----------------------------------------------------------------------------- */

%{
#include <string_view>
#include <string>
%}

namespace std {

%naturalvar string_view;

class string_view;

// string_view
%typemap(ctype) string_view "const char *"
%typemap(imtype) string_view "string"
%typemap(cstype) string_view "string"

%typemap(csdirectorin) string_view "$iminput"
%typemap(csdirectorout) string_view "$cscall"

%typemap(in, canthrow=1) string_view
%{ if (!$input) {
    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
    return $null;
   }
   $1 = std::string_view($input); %}
%typemap(out) string_view %{ $result = SWIG_csharp_string_callback(std::string($1).c_str()); %}

%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) string_view
%{ if (!$input) {
    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
    return $null;
   }
   /* possible thread/reentrant code problem */
   static std::string $1_str;
   $1_str = $input;
   $result = std::string_view($1_str); %}

%typemap(directorin) string_view %{ $input = std::string($1).c_str(); %}

%typemap(csin) string_view "$csinput"
%typemap(csout, excode=SWIGEXCODE) string_view {
    string ret = $imcall;$excode
    return ret;
  }

%typemap(typecheck) string_view = char *;

%typemap(throws, canthrow=1) string_view
%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, std::string($1).c_str());
   return $null; %}

// const string_view &
%typemap(ctype) const string_view & "const char *"
%typemap(imtype) const string_view & "string"
%typemap(cstype) const string_view & "string"

%typemap(csdirectorin) const string_view & "$iminput"
%typemap(csdirectorout) const string_view & "$cscall"

%typemap(in, canthrow=1) const string_view &
%{ if (!$input) {
    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
    return $null;
   }
   $*1_ltype $1_str($input);
   $1 = &$1_str; %}
%typemap(out) const string_view & %{ $result = SWIG_csharp_string_callback(std::string(*$1).c_str()); %}

%typemap(csin) const string_view & "$csinput"
%typemap(csout, excode=SWIGEXCODE) const string_view & {
    string ret = $imcall;$excode
    return ret;
  }

%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string_view &
%{ if (!$input) {
    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
    return $null;
   }
   /* possible thread/reentrant code problem */
   static std::string $1_str;
   $1_str = $input;
   static $*1_ltype $1_strview;
   $1_strview = $1_str;
   $result = &$1_strview; %}

%typemap(directorin) const string_view & %{ $input = std::string($1).c_str(); %}

%typemap(csvarin, excode=SWIGEXCODE2) const string_view & %{
    set {
      $imcall;$excode
    } %}
%typemap(csvarout, excode=SWIGEXCODE2) const string_view & %{
    get {
      string ret = $imcall;$excode
      return ret;
    } %}

%typemap(typecheck) const string_view & = char *;

%typemap(throws, canthrow=1) const string_view &
%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, std::string($1).c_str());
   return $null; %}

}