GenericFileSystem< file_type > Class Template Reference

A generic unix-style file-system which maps paths to files and directories. Provides average O(log n) find and insert methods. More...

#include <fs_filesystem.h>

Data Structures

class  Entry
class  Path

Public Types

typedef Entries::iterator iterator
typedef Entries::value_type value_type
typedef Entry entry_type

Public Member Functions

iterator begin ()
iterator end ()
entry_typeoperator[] (const Path &path)
 Returns the file at path. Creates all directories below path if they do not exist. O(log n) on average.
iterator find (const Path &path)
 Returns the file at path or end() if not found.
iterator begin (const std::string &root)
template<typename visitor_type >
void traverse (visitor_type visitor, const std::string &root)
 Performs a depth-first traversal of the file-system subtree rooted at root. Traverses the entire tree if root is "". Calls visitor.file() with the path to each file relative to the filesystem root. Calls visitor.directory() with the path to each directory relative to the filesystem root.

Private Types

typedef std::map< Path, EntryEntries

Private Attributes

Entries m_entries

Detailed Description

template<typename file_type>
class GenericFileSystem< file_type >

A generic unix-style file-system which maps paths to files and directories. Provides average O(log n) find and insert methods.

Parameters:
file_type The data type which represents a file.

Definition at line 60 of file fs_filesystem.h.


Member Typedef Documentation

template<typename file_type>
typedef std::map<Path, Entry> GenericFileSystem< file_type >::Entries [private]

Definition at line 115 of file fs_filesystem.h.

template<typename file_type>
typedef Entry GenericFileSystem< file_type >::entry_type

Definition at line 121 of file fs_filesystem.h.

template<typename file_type>
typedef Entries::iterator GenericFileSystem< file_type >::iterator

Definition at line 119 of file fs_filesystem.h.

template<typename file_type>
typedef Entries::value_type GenericFileSystem< file_type >::value_type

Definition at line 120 of file fs_filesystem.h.


Member Function Documentation

template<typename file_type>
iterator GenericFileSystem< file_type >::begin ( const std::string root  )  [inline]

Definition at line 159 of file fs_filesystem.h.

template<typename file_type>
iterator GenericFileSystem< file_type >::begin (  )  [inline]

Definition at line 123 of file fs_filesystem.h.

Referenced by GenericFileSystem< ZipRecord >::traverse().

template<typename file_type>
iterator GenericFileSystem< file_type >::end (  )  [inline]
template<typename file_type>
iterator GenericFileSystem< file_type >::find ( const Path path  )  [inline]

Returns the file at path or end() if not found.

Definition at line 154 of file fs_filesystem.h.

template<typename file_type>
entry_type& GenericFileSystem< file_type >::operator[] ( const Path path  )  [inline]

Returns the file at path. Creates all directories below path if they do not exist. O(log n) on average.

Definition at line 135 of file fs_filesystem.h.

template<typename file_type>
template<typename visitor_type >
void GenericFileSystem< file_type >::traverse ( visitor_type  visitor,
const std::string root 
) [inline]

Performs a depth-first traversal of the file-system subtree rooted at root. Traverses the entire tree if root is "". Calls visitor.file() with the path to each file relative to the filesystem root. Calls visitor.directory() with the path to each directory relative to the filesystem root.

Definition at line 176 of file fs_filesystem.h.


Field Documentation

template<typename file_type>
Entries GenericFileSystem< file_type >::m_entries [private]

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

Generated by  doxygen 1.6.2