The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XS::Framework::Manual::SVAPI::Io - XS::Framework IO C++ class reference

Io

Overview

The Io class is the wrapper around Perls IO* type. As with other type, it might hold an underlying Perl SV* or might not.

The Io object does not holds undef; if undef is assigned or supplied in constructor, the object is considered empty. In other words the undef and NULL have the same meaning for the class.

An IO is a structure which corresponds to a Perl file handles, sockets, pipes, etc, for example *STDOUT{IO}.

Construction

To create an wrapper around existing IO* the following constructors can be used:

    Io (std::nullptr_t = nullptr)
    Io (SV* sv, bool policy = INCREMENT)
    Io (GV* sv, bool policy = INCREMENT)
    Io (IO* sv, bool policy = INCREMENT)
    Io (const Io& oth)
    Io (Io&&      oth)
    Io (const Sv& oth)
    Io (Sv&&      oth)

If arguments is undef or NULL, the returned Io object will be empty.

Supported values are

IO
Reference to IO
Glob containing non-null IO slot
Reference to glob containing non-null IO slot

Otherwise, if unappropriate value is supplied, then exception will be thrown.

As with all other SVAPI classes, assigment operators, get, set and dereferencing are supported.

int fileno() const

Returns file descriptor of underlying PerlIO. This method is NULL-unsafe.

char iotype() const

Returns the type of underlying PerlIO as per IoTYPE(). This method is NULL-unsafe.