~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Lib/pike/std_string.i

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-06 10:27:08 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206102708-t37t62i45n595w0e
Tags: 1.3.33-2ubuntu1
* Merge with Debian; remaining changes:
  - Drop support for pike.
  - Use python2.5 instead of python2.4.
  - Clean Runtime/ as well.
  - Force a few environment variables.
* debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    %typemap(in, pikedesc="tStr") string {
26
26
      if ($input.type != T_STRING)
27
27
        Pike_error("Bad argument: Expected a string.\n");
28
 
      $1 = std::string(STR0($input.u.string));
 
28
      $1.assign(STR0($input.u.string));
29
29
    }
30
30
 
31
31
    %typemap(in, pikedesc="tStr") const string & (std::string temp) {
32
32
      if ($input.type != T_STRING)
33
33
        Pike_error("Bad argument: Expected a string.\n");
34
 
      temp = std::string(STR0($input.u.string));
 
34
      temp.assign(STR0($input.u.string));
35
35
      $1 = &temp;
36
36
    }
37
37
 
45
45
    
46
46
    %typemap(directorout) string {
47
47
      if ($input.type == T_STRING)
48
 
        $result = std::string(STR0($input.u.string));
 
48
        $result.assign(STR0($input.u.string));
49
49
      else
50
50
        throw Swig::DirectorTypeMismatchException("string expected");
51
51
    }
52
52
    
53
53
    %typemap(directorout) const string & (std::string temp) {
54
54
      if ($input.type == T_STRING) {
55
 
        temp = std::string(STR0($input.u.string));
 
55
        temp.assign(STR0($input.u.string));
56
56
        $result = &temp;
57
57
      } else {
58
58
        throw Swig::DirectorTypeMismatchException("string expected");