File: simple.pm

package info (click to toggle)
libextutils-xspp-perl 0.1800-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 992 kB
  • sloc: perl: 8,324; cpp: 125; makefile: 2
file content (27 lines) | stat: -r--r--r-- 509 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package ExtUtils::XSpp::Exception::simple;
use strict;
use warnings;

use base 'ExtUtils::XSpp::Exception';

sub init {
  my $this = shift;
  $this->SUPER::init(@_);
}

sub handler_code {
  my $this = shift;
  my $no_spaces_indent = shift;
  $no_spaces_indent = 4 if not defined $no_spaces_indent;

  my $ctype = $this->cpp_type;
  my $msg = "Caught C++ exception of type '$ctype'";
  my $code = <<HERE;
catch ($ctype& e) {
  croak("$msg");
}
HERE
  return $this->indent_code($code, $no_spaces_indent);
}

1;