Changeset 33

Show
Ignore:
Timestamp:
01/21/01 21:39:32
Author:
miyagawa
Message:

modified docs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Mac-Macbinary/trunk/README

    r24 r33  
    11NAME 
    2     Mac::Macbinary - Decodes Macbinary files. 
     2    Mac::Macbinary - Decodes Macbinary files 
    33 
    44SYNOPSIS 
    55      use Mac::Macbinary; 
    66 
    7       $mb = new Mac::Macbinary(\*FH);       # filehandle 
    8       $mb = new Mac::Macbinary($fh);        # IO::* instance 
    9       $mb = new Mac::Macbinary("/path/to/file"); 
     7      $mb = Mac::Macbinary->new(\*FH);      # filehandle 
     8      $mb = Mac::Macbinary->new($fh);       # IO::* instance 
     9      $mb = Mac::Macbinary->new("/path/to/file"); 
    1010 
    1111      $header = $mb->header;                # Mac::Macbinary::Header instance 
    1212      $name = $header->name; 
    13  
     13   
    1414DESCRIPTION 
    1515    This module provides an object-oriented way to extract various kinds of 
     
    2424        Constructor of Mac::Macbinary. Accepts filhandle GLOB reference, 
    2525        FileHandle instance, IO::* instance, or whatever objects that can do 
    26         `read' methods. 
     26        "read" methods. 
    2727 
    28         If the argument belongs none of those above, `new()' treats it as a 
     28        If the argument belongs none of those above, "new()" treats it as a 
    2929        path to file. Any of following examples are valid constructors. 
    3030 
    3131          open FH, "path/to/file"; 
    32           $mb = new Mac::Macbinary(\*FH); 
     32          $mb = Mac::Macbinary->new(\*FH); 
    3333 
    34           $fh = new FileHandle "path/to/file"
    35           $mb = new Mac::Macbinary($fh); 
     34          $fh = FileHandle->new("path/to/file")
     35          $mb = Mac::Macbinary->new($fh); 
    3636 
    37           $io = new IO::File "path/to/file"
    38           $mb = new Mac::Macbinary($io); 
     37          $io = IO::File->new("path/to/file")
     38          $mb = Mac::Macbinary->new($io); 
    3939 
    40           $mb = new Mac::Macbinary "path/to/file"
     40          $mb = Mac::Macbinary->new("path/to/file")
    4141 
    42         `new()' throws an exception "Can't read blahblah" if the given 
     42        "new()" throws an exception "Can't read blahblah" if the given 
    4343        argument to the constructor is neither a valid filehandle nor an 
    4444        existing file. 
     
    5252        returns the header object (instance of Mac::Macbinary::Header). 
    5353 
    54     Following accessors are available via Mac::Macbinary instance. 
     54    Following accessors are available via Mac::Macbinary::Header instance. 
    5555 
    5656    name, type, creator, flags, location, dflen, rflen, cdate, mdate 
     
    8383      $filename = $q->param('uploaded_file'); 
    8484      $type = $q->uploadInfo($filename)->{'Content-Type'}; 
    85       
     85  
    8686      if ($type eq 'application/x-macbinary') { 
    8787          $mb = Mac::Macbinary->new($q->upload('uploaded_file')); 
     
    8989      }  
    9090 
    91 TODO 
    92     should add `is_macbinary()', to detect if a file is a Macbinary file or 
    93     not. 
     91COPYRIGHT 
     92    Copyright 2000 Tatsuhiko Miyagawa <miyagawa@bulknews.net> 
    9493 
    95 AUTHOR 
    96     Tatsuhiko Miyagawa <miyagawa@bulknews.net> 
     94    This library is free software; you can redistribute it and/or modify it 
     95    under the same terms as Perl itself. 
    9796 
    9897ACKNOWLEDGEMENT 
    9998    Macbinary.pm is originally written by Dan Kogai <dankogai@dan.co.jp>. 
    10099 
    101     There are also `Mac::Conversions' and `Convert::BinHex', working kind 
    102     similar to this module. (However, `Mac::Conversions' works only on 
    103     MacPerl, and `Convert::BinHex' is now deprecated.) Many thanks to Paul J. 
    104     Schinder and Eryq, authors of those ones. 
     100    There are also "Mac::Conversions" and "Convert::BinHex", working kind 
     101    similar to this module. (However, "Mac::Conversions" works only on 
     102    MacPerl, and "Convert::BinHex" is now deprecated.) Many thanks to Paul 
     103    J. Schinder and Eryq, authors of those ones. 
     104 
     105    Macbinary validation is almost a replication of is_macbinary in 
     106    Mac::Conversions. 
    105107 
    106108SEE ALSO