NAME
mock::Win32::API - Mock interface to Windows dlls.
SYNOPSIS
use lib qw{ inc/mock };
use Win32::API;
my $lft2ft = Win32::API->new(
KERNEL32 => 'LocalFileTimeToFileTime',
[ qw{ P P } ], 'I' );
my $lft = windows_style_local_file_time();
my $ft = $lft; # Just to get space allocated
$lft2ft->Call( $lft, $ft )
or die "Call failed";
DESCRIPTION
This module is private to this distribution. It can be changed or retracted without notice. Documentation is for the benefit of the author.
This Perl class mocks the Win32::API module and whatever system calls are needed by this package.
METHODS
This class supports the following methods, which are private to this package:
new
my $lft2ft = Win32::API->new(
KERNEL32 => 'LocalFileTimeToFileTime',
[ qw{ P P } ], 'I' );
This static method instantiates the object. The arguments are the name of the DLL being mapped, the name of the function in that DLL, a reference to an array encoding the types of the arguments to that function, and the type of the return value. There must be a mocked version of the function already coded in this module. The arguments will be checked.
Call
$lft2ft->Call( $lft, $ft )
or die "Call failed";
This method invokes the mocked function. Just as in the case of the real Win32::API, all output arguments must already have space preallocated.
SEE ALSO
Win32::API (the real one).
SUPPORT
Support is by the author. Please file bug reports at https://rt.cpan.org/Public/Dist/Display.html?Name=Win32API-File-Time, https://github.com/trwyant/perl-Win32API-File-Time/issues, or in electronic mail to the author.
AUTHOR
Tom Wyant (wyant at cpan dot org)
COPYRIGHT AND LICENSE
Copyright (C) 2016-2017, 2019-2021 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
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.