From b05a5d6fe38eb7a5d117acf6d5c8808413d304e5 Mon Sep 17 00:00:00 2001 From: Tomek Piotrowski Date: Sat, 7 May 2016 20:37:48 +0200 Subject: [PATCH] Add VolumeDirectory and VolumeItem doc pages --- .../volumes_and_files/volumedirectory.rst | 34 +++++++++++ .../volumes_and_files/volumefile.rst | 36 ++--------- .../volumes_and_files/volumeitem.rst | 59 +++++++++++++++++++ 3 files changed, 97 insertions(+), 32 deletions(-) create mode 100644 doc/source/structures/volumes_and_files/volumedirectory.rst create mode 100644 doc/source/structures/volumes_and_files/volumeitem.rst diff --git a/doc/source/structures/volumes_and_files/volumedirectory.rst b/doc/source/structures/volumes_and_files/volumedirectory.rst new file mode 100644 index 000000000..ab61b793f --- /dev/null +++ b/doc/source/structures/volumes_and_files/volumedirectory.rst @@ -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. + diff --git a/doc/source/structures/volumes_and_files/volumefile.rst b/doc/source/structures/volumes_and_files/volumefile.rst index 65c49d083..dbdf7b307 100644 --- a/doc/source/structures/volumes_and_files/volumefile.rst +++ b/doc/source/structures/volumes_and_files/volumefile.rst @@ -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 ` command. @@ -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 ` (bytes) - - Size of the file * - :meth:`READALL` - :struct:`FileContent` - Reads file contents @@ -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 ` - - size of the file, in bytes. - - .. method:: VolumeFile:READALL :return: :struct:`FileContent` diff --git a/doc/source/structures/volumes_and_files/volumeitem.rst b/doc/source/structures/volumes_and_files/volumeitem.rst new file mode 100644 index 000000000..8e1e07b22 --- /dev/null +++ b/doc/source/structures/volumes_and_files/volumeitem.rst @@ -0,0 +1,59 @@ +.. _volumeitem: + +VolumeItem +========== + +Contains suffixes common to :struct:`files ` and :struct:`directories `. + +.. 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 +