Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
Friends | List of all members
iMS::FileSystemTableViewer Class Reference

Provides a mechanism for viewing the FileSystemTable associated with an iMS System. More...

#include <include\FileSystem.h>

Public Member Functions

Constructor
 FileSystemTableViewer (const IMSSystem &ims)
 Constructor for FileSystemTableViewer Object. More...
 
FileSystem Table Information
const bool IsValid () const
 Indicates whether FileSystemTable object is valid. More...
 
const int Entries () const
 
Array operator for random access to FileSystemTableEntry s
const FileSystemTableEntry operator[] (const std::size_t idx) const
 The FileSystemTable consists of a container of FileSysteTableEntry objects. Each object may be accessed by calling the viewer object through an array subscript. More...
 

Friends

LIBSPEC std::ostream & operator<< (std::ostream &stream, const FileSystemTableViewer &)
 Stream operator overload to simplify debugging. More...
 

Detailed Description

Provides a mechanism for viewing the FileSystemTable associated with an iMS System.

Author
Dave Cowan
Date
2016-01-21
Since
1.1

Constructor & Destructor Documentation

iMS::FileSystemTableViewer::FileSystemTableViewer ( const IMSSystem ims)
inline

Constructor for FileSystemTableViewer Object.

The FileSystemTableViewer object requires an IMSSystem object, which will have had its FileSystemTable read back during initialisation. It must therefore exist before the FileSystemTableViewer object, and must remain valid (not destroyed) until the FileSystemTableViewer object itself is destroyed.

Once constructed, the object can neither be copied or assigned to another instance.

Parameters
[in]imsA const reference to the iMS System whose FileSystemTable is to be viewed.
Since
1.1

Member Function Documentation

const int iMS::FileSystemTableViewer::Entries ( ) const
Returns
The current number of file entries stored in the FileSystemTable
Since
1.1
const bool iMS::FileSystemTableViewer::IsValid ( ) const

Indicates whether FileSystemTable object is valid.

For a FileSystemTable stored on the Synthesiser to be considered valid, certain parameters need to be met. If the initialisation process is unable to establish validity of a FileSystemTable it will mark it as void and the user will not be able to work with it until a new FileSystem has been created and downloaded.

User code should therefore check that the FileSystemTable is valid before working with it.

Returns
true if the FileSystemTable is considered valid.
Since
1.1
const FileSystemTableEntry iMS::FileSystemTableViewer::operator[] ( const std::size_t  idx) const

The FileSystemTable consists of a container of FileSysteTableEntry objects. Each object may be accessed by calling the viewer object through an array subscript.

For example:

if (fstv.IsValid()) {
int length = 0;
for (int i=0; i<fstv.Entries(); i++) {
length += fstv[i].Length();
}
std::cout << "Used space in filesystem: " << length << " bytes" << std::endl;
}
Since
1.1

Friends And Related Function Documentation

LIBSPEC std::ostream& operator<< ( std::ostream &  stream,
const FileSystemTableViewer  
)
friend

Stream operator overload to simplify debugging.

Example usage:

if (!fstv.IsValid()) {
std::cout << "No Filesystem found" << std::endl;
}
else {
std::cout << fstv;
}

might produce the result:

FST[00]* : Type 1 Addr : 8708 Len : 16386 Name : CompTbl1
FST[01] : Type 1 Addr : 38924 Len : 16386 Name : CompTbl2
FST[02]* : Type 2 Addr : 1024 Len : 6146 Name : ToneUp
FST[03] : Type 2 Addr : 25094 Len : 6146 Name : ToneDown
FST[04] : Type 15 Addr : 55310 Len : 1538 Name : User5
FST[05] : Type 15 Addr : 56848 Len : 1538 Name : User5
FST[06] : Type 3 Addr : 7170 Len : 17 Name : DDS100M

where The index into the FileSystemTable (FST) is given followed by an asterisk if the entry is marked as Default (Execute on startup). Then the File Type is given (refer to FileSystemTypes), followed by the starting address in memory then the number of bytes occupied and finally the allocated filename.


The documentation for this class was generated from the following file: