OLE-Storage

 view release on metacpan or  search on metacpan

Storage.pm  view on Meta::CPAN

#
# $Id: Storage.pm,v 1.8 1998/04/28 00:39:43 schwartz Exp $
#
# OLE::Storage, a Structured Storage interface 
#
# Also known as: Laola filesystem.
#
# (POD documentation at end of file)
#
# This perl 5 library gives raw access to "Ole/Com" documents. These are 
# documents like created by Microsoft Word 6.0+ or newer Star Divisions 
# Word by using so called "Structured Storage" technology. Write access 
# still is nearly not supported, but will be done one day. This library 
# should have come along with a couple of other files. The whole 
# distribution can be found at:
#
#    http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/index.html
# or
#    http://www.cs.tu-berlin.de/~schwartz/pmh/index.html
#
# Copyright (C) 1996, 1997 Martin Schwartz 
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, you should find it at:
#
#    http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/COPYING
#
# Diese Veröffentlichung erfolgt ohne Berücksichtigung eines eventuellen
# Patentschutzes. Warennamen werden ohne Gewährleistung einer freien 
# Verwendung benutzt. ;-)
#
# Contact: schwartz@cs.tu-berlin.de
#

#
# Really important topics still MISSING until now:
#
#   - Human rights and civil rights where you live.
#
#   - Reformfraktion president for Technische Universität Berlin.
#
#   - creating documents 
#   - many property set things: 
#     *  documentation of variable types
#     *  code page support
#   - consistant name giving, checked against MS'
#

package OLE::Storage;
my $VERSION=do{my@R=('$Revision: 1.8 $'=~/\d+/g);sprintf"%d."."%d"x$#R,@R};
$[=0;

#  
# Storage.pm has public method interfaces and private functions. Functions
# assume a local($S) as $self. I put some efforts into making it strict-proof,
# especially to "methodize" all functions, but I didn't like the resulting 
# code. May be I'll regret this once ;-), but momentarily I'm quite ok with: 
# 
no strict; $^W=0;

#
# Abbreviations
# 
#    bbd    Big Block Depot
#    pps    Property Storage
#    ppset  Property Set
#    ppss   Property Set Storage
#    sb     Start Block
#    sbd    Small Block Depot
# 

use OLE::Storage::Std;
use OLE::Storage::Var();
use OLE::Storage::Io(); 
use OLE::Storage::Iolist(); 

sub Startup  { my $S=shift; $S->{STARTUP} = shift if @_; $S->{STARTUP} }
sub Var      { my $S=shift; $S->{VAR}     = shift if @_; $S->{VAR} }
sub NewVar   { OLE::Storage::Var::new qw(OLE::Storage::Var) }

sub _error   { $S->{STARTUP} ? $S->{STARTUP}->error(@_) : 0 }

##
## File and directory handling
##

sub check {
#
# 1||0 = check($Startup, $file [,$mode [,\$streambuf]]);
#
   # to do!
   my ($proto, $Startup, $name, $mode, $bufR) = @_;
   my $Io = OLE::Storage::Io->open($Startup, $name, $mode, $bufR)
}

sub open { 
#
# $Doc||0 = open($Startup, $Var, $file [,$mode [,\$streambuf]]);
#
# mode bitmask (0 is default):
#
# Bit 0 (0 read only, 1 read and write)
# Bit 4 (0 file mode, 1 buffer mode)
#
# Own errors:
#
#	1   "'Var' object not specified!"
#	2   IO->open error
#       3   _init_doc error
#
   my ($proto, $Startup, $Var, $name, $mode, $bufR) = @_;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.419 second using v1.00-cache-2.02-grep-82fe00e-cpan-f73e49a70403 )