Skip to content

Commit

Permalink
Add VolumeDirectory and VolumeItem doc pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekpiotrowski committed May 12, 2016
1 parent 2ba2514 commit b05a5d6
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 32 deletions.
34 changes: 34 additions & 0 deletions doc/source/structures/volumes_and_files/volumedirectory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _volumedirectory:

VolumeDirecotry
===============

Represents a directory on a kOS file system.

Instances of this class are enumerable, every step of iteration will provide a :struct:`VolumeFile` or a :struct:`VolumeDirectory` contained in this directory.

.. structure:: VolumeDirectory

.. list-table:: Members
:header-rows: 1
:widths: 1 1 4

* - Suffix
- Type
- Description

* - All suffixes of :struct:`VolumeItem`
-
- :struct:`VolumeDirectory` objects are a type of :struct:`VolumeItem`

* - :meth:`LIST`
- :struct:`List` of :struct:`VolumeFile` or :struct:`VolumeDirectory`
- Lists all files and directories


.. method:: VolumeDirectory:LIST

:return: :struct:`List` of :struct:`VolumeFile` or :struct:`VolumeDirectory`

Returns a list of all files and directories in this directory.

36 changes: 4 additions & 32 deletions doc/source/structures/volumes_and_files/volumefile.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _volumefile:

VolumeFile
================
==========

File name and size information. You can obtain a list of values of type VolumeFile using the :ref:`LIST FILES <list command>` command.

Expand All @@ -15,16 +15,10 @@ File name and size information. You can obtain a list of values of type VolumeFi
- Type
- Description

* - All suffixes of :struct:`VolumeItem`
-
- :struct:`VolumeFile` objects are a type of :struct:`VolumeItem`

* - :attr:`NAME`
- :struct:`String`
- Name of the file including extension
* - :attr:`EXTENSION`
- :struct:`String`
- File extension
* - :attr:`SIZE`
- :ref:`scalar <scalar>` (bytes)
- Size of the file
* - :meth:`READALL`
- :struct:`FileContent`
- Reads file contents
Expand All @@ -39,28 +33,6 @@ File name and size information. You can obtain a list of values of type VolumeFi
- Clears this file


.. attribute:: VolumeFile:NAME

:access: Get only
:type: :struct:`String`

name of the file, including its file extension.

.. attribute:: VolumeFile:EXTENSION

:access: Get only
:type: :struct:`String`

File extension (part of the filename after the last dot).

.. attribute:: VolumeFile:SIZE

:access: Get only
:type: :ref:`scalar <scalar>`

size of the file, in bytes.


.. method:: VolumeFile:READALL

:return: :struct:`FileContent`
Expand Down
59 changes: 59 additions & 0 deletions doc/source/structures/volumes_and_files/volumeitem.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.. _volumeitem:

VolumeItem
==========

Contains suffixes common to :struct:`files <VolumeFile>` and :struct:`directories <VolumeDirectory>`.

.. structure:: VolumeItem

.. list-table:: Members
:header-rows: 1
:widths: 1 1 4

* - Suffix
- Type
- Description


* - :attr:`NAME`
- :struct:`String`
- Name of the item including extension
* - :attr:`EXTENSION`
- :struct:`String`
- Item extension
* - :attr:`SIZE`
- :struct:`Scalar`
- Size of the file
* - :attr:`ISFILE`
- :struct:`Scalar`
- Size of the file

.. attribute:: VolumeItem:NAME

:access: Get only
:type: :struct:`String`

Name of the item, including the extension.

.. attribute:: VolumeItem:EXTENSION

:access: Get only
:type: :struct:`String`

Item extension (part of the name after the last dot).

.. attribute:: VolumeItem:SIZE

:access: Get only
:type: :struct:`Scalar`

Size of the item, in bytes.

.. attribute:: VolumeItem:ISFILE

:access: Get only
:type: :struct:`Boolean`

True if this item is a file

0 comments on commit b05a5d6

Please sign in to comment.