Directry file listing class Instance will be a vector of string class which holds the file name of given path.

Dependents:   ika_shouyu_poppoyaki DirectoryList_Hello ika_shouyu_poppoyaki eVY1_SMF_player ... more

Embed: (wiki syntax)

« Back to documentation index

DirectoryList Class Reference

DirectoryList Class Reference

DirectoryList class. More...

#include <DirectoryList.h>

Public Member Functions

 DirectoryList (char *path)
 Create a DirectoryList instance of specified path.
 DirectoryList (std::string path)
 Create a DirectoryList instance of specified path.
 ~DirectoryList ()
 Destructor of DirectoryList.
int error_check (void)
 Error check function.

Detailed Description

DirectoryList class.

Simple interface to get file name list of directory which is specified by path.

The DirectoryList instance will be an object of "std::vector<std::string>".

This library works on local strage on mbed as well as on USB strage. (It has not been tested on SD yet.)

Example:

  #include "mbed.h"
  #include "DirectoryList.h"

  LocalFileSystem local( "local" );
  
  int main(void)
  {
      DirectoryList   dir( "/local" );

      if ( dir.error_check() )
          error( "directory could not be opened\r\n" );

      for ( int i = 0; i < dir.size(); i++ )
          printf( "%s\r\n", dir[ i ].c_str() );
  }

Definition at line 48 of file DirectoryList.h.


Constructor & Destructor Documentation

DirectoryList ( char *  path )

Create a DirectoryList instance of specified path.

DirectoryList library.

Parameters:
pathstring which tells directory path
Author:
Tedd OKANO
Version:
0.1
Date:
Jan-2015

A simple directory listing interface

Definition at line 15 of file DirectoryList.cpp.

DirectoryList ( std::string  path )

Create a DirectoryList instance of specified path.

Parameters:
pathstring which tells directory path

Definition at line 20 of file DirectoryList.cpp.

~DirectoryList (  )

Destructor of DirectoryList.

Definition at line 44 of file DirectoryList.cpp.


Member Function Documentation

int error_check ( void   )

Error check function.

Returns:
zero if no error

Definition at line 48 of file DirectoryList.cpp.