GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Test::Inline::IO::File(3) User Contributed Perl Documentation Test::Inline::IO::File(3)

Test::Inline::IO::File - Test::Inline Local Filesystem IO Handler

version 2.214

Test::Inline::IO::File is the default IO handler for Test::Inline.

Test::Inline 2.0 was conceived in an enterprise setting, and retains the flexibilty, power, and bulk that this created, although for most users the power and complexity that is available is largely hidden away under multiple layers of sensible defaults.

The intent with the "InputHandler" and "OutputHandle" parameters is to allow Test::Inline to be able to pull source data from anywhere, and write the resulting test scripts to anywhere.

Until a more powerful pure-OO file-system API comes along, this module serves as a minimalist implementation of the subset of functionality that Test::Inline needs in order to work.

An alternative IO Handler class need not subclass this one (although it is recommended), merely implement the same interface, taking whatever alternative arguments to the "new" constructor that it wishes.

All methods in this class are provided with unix-style paths, and should do the translating to the underlying filesystem themselves if required.

  # Simplified usage
  $io_handler = Test::Inline::IO::File->new( $path );
  
  # Full key/value usage
  $io_handler = Test::Inline::IO::File->new(
          path     => $path,
          readonly => 1,
  );

The "new" constructor takes a root path on the local filesystem and returns a new "Test::Inline::IO::File" object to that location.

The "exists_file" method checks to see if a particular file currently exists in the input handler.

Returns true if it exists, or false if not.

The "exists_dir" method checks to see if a particular directory currently exists in the input handler.

Returns true if it exists, or false if not.

The "read" method reads in the entire contents of a single file, returning it as a reference to a SCALAR. It also localises the newlines as it does this, so files from different operating systems should read as you expect.

Returns a SCALAR reference, or "undef" on error.

The "write" method writes a string to a file in one hit, creating it and it's path if needed.

Assuming your input FileHandler is pointing at the root directory of a lib path (meaning that My::Module will be located at My/Module.pm within it) the "class_file" method will take a class name, and check to see if the file for that class exists in the FileHandler.

Returns a reference to an ARRAY containing the filename if it exists, or "undef" on error.

The "find" method takes as argument a directory root class, and then scans within the input FileHandler to find all files contained in that class or any other classes under it's namespace.

Returns a reference to an ARRAY containing all the files within the class, or "undef" on error.

- Convert to using FSI::FileSystem objects, once they exist

See the main SUPPORT section.

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Inline> (or bug-Test-Inline@rt.cpan.org <mailto:bug-Test-Inline@rt.cpan.org>).

Adam Kennedy <adamk@cpan.org>

This software is copyright (c) 2003 by Adam Kennedy.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2021-01-23 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.