VirtualBox

Ignore:
Timestamp:
Jul 7, 2018 4:20:42 PM (6 years ago)
Author:
vboxsync
Message:

Main: Introducing IMediumIO for accessing the content of a medium. The new IMedium::openForIO method instantiates and returns this interface. N.B. Write access hasn't been implemented yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r72919 r72948  
    1502615026  <interface
    1502715027    name="IMedium" extends="$unknown"
    15028     uuid="4afe423b-43e0-e9d0-82e8-ceb307940dda"
     15028    uuid="c3a390cd-4efa-458d-2afb-d07eb4e105bb"
    1502915029    wsmap="managed"
    1503015030    reservedMethods="4" reservedAttributes="8"
     
    1635016350    </method>
    1635116351
     16352    <method name="openForIO">
     16353      <desc>
     16354        Open the medium for I/O.
     16355      </desc>
     16356      <param name="writable" type="boolean" dir="in">
     16357       <desc>Set this to open the medium for both reading and writing.  When
     16358             not set the medium is opened readonly.</desc>
     16359      </param>
     16360      <param name="password" type="wstring" dir="in">
     16361        <desc>Password for accessing an encrypted medium. Must be empty if not encrypted.</desc>
     16362      </param>
     16363      <param name="mediumIO" type="IMediumIO" dir="return">
     16364        <desc>Medium I/O object.</desc>
     16365      </param>
     16366    </method>
     16367
    1635216368  </interface>
    1635316369
     
    1657916595        <desc>Array of default property values.</desc>
    1658016596      </param>
     16597    </method>
     16598
     16599  </interface>
     16600
     16601  <!--
     16602  // IMediumIO
     16603  /////////////////////////////////////////////////////////////////////////
     16604  -->
     16605
     16606  <enum
     16607    name="PartitionTableType"
     16608    uuid="360066eb-d19e-4fa1-57ef-fed434fbe2a9"
     16609    >
     16610    <desc>
     16611      Partition table types.
     16612    </desc>
     16613
     16614    <const name="MBR" value="1"/>
     16615    <const name="GPT" value="2"/>
     16616  </enum>
     16617
     16618
     16619  <interface
     16620    name="IMediumIO" extends="$unknown"
     16621    uuid="43b03a91-ea1a-4bdb-506f-8c418b72d6a3"
     16622    wsmap="managed"
     16623    reservedMethods="4" reservedAttributes="8"
     16624    >
     16625    <desc>
     16626      The IMediumIO interface is used to access and modify the content of a
     16627      medium.  It is returned by <link to="IMedium::openForIO"/>.
     16628    </desc>
     16629
     16630    <attribute name="medium" type="IMedium" readonly="yes">
     16631      <desc>The open medium.</desc>
     16632    </attribute>
     16633
     16634    <attribute name="writable" type="boolean" readonly="yes">
     16635      <desc>Whether the medium can be written to. (It can always be read from.)</desc>
     16636    </attribute>
     16637
     16638    <attribute name="explorer" type="IVFSExplorer" readonly="yes">
     16639      <desc>
     16640        Returns the virtual file system explorer for the medium.
     16641
     16642        This will attempt to recognize the format of the medium content and
     16643        present it as a virtual directory structure to the API user.
     16644
     16645        A FAT floppy image will be represented will a single root subdir 'fat12'
     16646        that gives access to the file system content.
     16647
     16648        A ISO-9660 image will have one subdir in the root for each format present
     16649        in the image, so the API user can select which data view to access (iso9660,
     16650        rockridge, jolie, udf, hfs, ...).
     16651
     16652        A partitioned harddisk image will have subdirs for each partition.  The
     16653        the filesystem content of each partition can be accessed thru the subdirs
     16654        if we have a file system interpreter for it.  There will also be raw files
     16655        for each subdirectory, to provide a simple way of accessing raw partition
     16656        data from an API client.
     16657
     16658        Please note that the explorer may show inconsistent information if
     16659        the API user modifies the raw image content after it was opened.
     16660      </desc>
     16661    </attribute>
     16662
     16663    <method name="read">
     16664      <desc>
     16665        Read data from the medium.
     16666      </desc>
     16667      <param name="offset" type="long long" dir="in">
     16668        <desc>The byte offset into the medium to start reading at.</desc>
     16669      </param>
     16670      <param name="size" type="unsigned long" dir="in">
     16671        <desc>How many bytes to try read.</desc>
     16672      </param>
     16673      <param name="data" type="octet" dir="return" safearray="yes">
     16674        <desc>Array of data read. This may be shorter than the specified size.</desc>
     16675      </param>
     16676    </method>
     16677
     16678    <method name="write">
     16679      <desc>
     16680        Write data to the medium.
     16681      </desc>
     16682      <param name="offset" type="long long" dir="in">
     16683        <desc>The byte offset into the medium to start reading at.</desc>
     16684      </param>
     16685      <param name="data" type="octet" dir="in" safearray="yes">
     16686        <desc>Array of data to write.</desc>
     16687      </param>
     16688      <param name="written" type="unsigned long" dir="return">
     16689        <desc>How many bytes were actually written.</desc>
     16690      </param>
     16691    </method>
     16692
     16693    <method name="formatFAT">
     16694      <desc>
     16695        Formats the medium as FAT.  Generally only useful for floppy images as
     16696        no partition table will be created.
     16697      </desc>
     16698      <param name="quick" type="boolean" dir="in">
     16699        <desc>Quick format it when set.</desc>
     16700      </param>
     16701    </method>
     16702
     16703    <method name="initializePartitionTable">
     16704      <desc>
     16705        Writes an empty partition table to the disk.
     16706      </desc>
     16707      <param name="format" type="PartitionTableType" dir="in">
     16708        <desc>The partition table format.</desc>
     16709      </param>
     16710      <param name="wholeDiskInOneEntry" type="boolean" dir="in">
     16711        <desc>
     16712           When @c true a partition table entry for the whole disk is created.
     16713           Otherwise the partition table is empty.
     16714        </desc>
     16715      </param>
     16716    </method>
     16717
     16718    <method name="close">
     16719      <desc>
     16720        Explictly close the medium I/O rather than waiting for garbage
     16721        collection and the destructor.
     16722
     16723        This will wait for any pending reads and writes to complete and then
     16724        close down the I/O access without regard for open explorer instances or
     16725        anything like that.
     16726      </desc>
    1658116727    </method>
    1658216728
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette