Representation of a directory tree.  
 More...
#include <cppfs/include/cppfs/Tree.h>
Representation of a directory tree. 
 
  
  
      
        
          | cppfs::Tree::Tree  | 
          ( | 
          const Tree &  | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
      
        
          | void cppfs::Tree::clear  | 
          ( | 
           | ) | 
           | 
        
      
 
 
      
        
          | const std::string& cppfs::Tree::path  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get path. 
- Returns
 - Path to file or directory
 
 
 
      
        
          | void cppfs::Tree::setPath  | 
          ( | 
          const std::string &  | 
          path | ) | 
           | 
        
      
 
Set path. 
- Parameters
 - 
  
    | [in] | path | Path to file or directory  | 
  
   
 
 
      
        
          | void cppfs::Tree::setPath  | 
          ( | 
          std::string &&  | 
          path | ) | 
           | 
        
      
 
Set path. 
- Parameters
 - 
  
    | [in] | path | Path to file or directory  | 
  
   
 
 
      
        
          | const std::string& cppfs::Tree::fileName  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get filename. 
- Returns
 - Filename 
 
 
 
      
        
          | void cppfs::Tree::setFileName  | 
          ( | 
          const std::string &  | 
          filename | ) | 
           | 
        
      
 
 
      
        
          | void cppfs::Tree::setFileName  | 
          ( | 
          std::string &&  | 
          filename | ) | 
           | 
        
      
 
 
      
        
          | bool cppfs::Tree::isFile  | 
          ( | 
           | ) | 
           const | 
        
      
 
Check if item is a file. 
- Returns
 - 'true' if it is a file, else 'false' 
 
 
 
      
        
          | bool cppfs::Tree::isDirectory  | 
          ( | 
           | ) | 
           const | 
        
      
 
Check if item is a directory. 
- Returns
 - 'true' if it is a directory, else 'false' 
 
 
 
      
        
          | void cppfs::Tree::setDirectory  | 
          ( | 
          bool  | 
          isDir | ) | 
           | 
        
      
 
Set directory. 
- Parameters
 - 
  
    | [in] | isDir | 'true' if it is a directory, else 'false'  | 
  
   
 
 
      
        
          | unsigned int cppfs::Tree::size  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get file size. 
- Returns
 - Size of file 
 
 
 
      
        
          | void cppfs::Tree::setSize  | 
          ( | 
          unsigned int  | 
          size | ) | 
           | 
        
      
 
Set file size. 
- Parameters
 - 
  
  
 
 
 
      
        
          | unsigned int cppfs::Tree::accessTime  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get time of last access. 
- Returns
 - Time stamp 
 
 
 
      
        
          | void cppfs::Tree::setAccessTime  | 
          ( | 
          unsigned int  | 
          time | ) | 
           | 
        
      
 
Set time of last access. 
- Parameters
 - 
  
  
 
 
 
      
        
          | unsigned int cppfs::Tree::modificationTime  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get time of last modification. 
- Returns
 - Time stamp 
 
 
 
      
        
          | void cppfs::Tree::setModificationTime  | 
          ( | 
          unsigned int  | 
          time | ) | 
           | 
        
      
 
Set time of last modification. 
- Parameters
 - 
  
  
 
 
 
      
        
          | unsigned int cppfs::Tree::userId  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get ID of owning user. 
- Returns
 - User ID 
 
 
 
      
        
          | void cppfs::Tree::setUserId  | 
          ( | 
          unsigned int  | 
          id | ) | 
           | 
        
      
 
Set ID of owning user. 
- Parameters
 - 
  
  
 
 
 
      
        
          | unsigned int cppfs::Tree::groupId  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get ID of owning group. 
- Returns
 - Group ID 
 
 
 
      
        
          | void cppfs::Tree::setGroupId  | 
          ( | 
          unsigned int  | 
          id | ) | 
           | 
        
      
 
Set ID of owning group. 
- Parameters
 - 
  
  
 
 
 
      
        
          | unsigned long cppfs::Tree::permissions  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get file permissions. 
- Returns
 - File permissions 
 
 
 
      
        
          | void cppfs::Tree::setPermissions  | 
          ( | 
          unsigned int  | 
          permissions | ) | 
           | 
        
      
 
Set file permissions. 
- Parameters
 - 
  
    | [in] | permissions | File permissions  | 
  
   
 
 
      
        
          | const std::string& cppfs::Tree::sha1  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get sha1 hash. 
- Returns
 - SHA1 hash 
 
 
 
      
        
          | void cppfs::Tree::setSha1  | 
          ( | 
          const std::string &  | 
          hash | ) | 
           | 
        
      
 
Set sha1 hash. 
- Parameters
 - 
  
  
 
 
 
      
        
          | void cppfs::Tree::setSha1  | 
          ( | 
          std::string &&  | 
          hash | ) | 
           | 
        
      
 
Set sha1 hash. 
- Parameters
 - 
  
  
 
 
 
      
        
          | std::vector<std::string> cppfs::Tree::listFiles  | 
          ( | 
           | ) | 
           const | 
        
      
 
List files in directory. 
- Returns
 - List of files, empty list if this is not a valid directory 
 
 
 
      
        
          | const std::vector< std::unique_ptr<Tree> >& cppfs::Tree::children  | 
          ( | 
           | ) | 
           const | 
        
      
 
Get children list. 
- Returns
 - List of children 
 
 
 
      
        
          | std::vector< std::unique_ptr<Tree> >& cppfs::Tree::children  | 
          ( | 
           | ) | 
           | 
        
      
 
Get children list. 
- Returns
 - List of children 
 
 
 
      
        
          | void cppfs::Tree::add  | 
          ( | 
          std::unique_ptr< Tree > &&  | 
          tree | ) | 
           | 
        
      
 
Add child. 
- Parameters
 - 
  
    | [in] | tree | Child tree (must NOT be null!) | 
  
   
 
 
      
        
          | void cppfs::Tree::print  | 
          ( | 
          const std::string &  | 
          indent = "" | ) | 
           const | 
        
      
 
Print tree to stdout. 
- Parameters
 - 
  
  
 
 
 
      
        
          | std::unique_ptr<Diff> cppfs::Tree::createDiff  | 
          ( | 
          const Tree &  | 
          target | ) | 
           const | 
        
      
 
Create diff from this state to target state. 
- Parameters
 - 
  
    | [in] | target | Target tree state | 
  
   
- Returns
 - Diff (never null)
 
 
 
  
  
      
        
          | const Tree& cppfs::Tree::operator=  | 
          ( | 
          const Tree &  | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | static void cppfs::Tree::createDiff  | 
          ( | 
          const Tree *  | 
          currentState,  | 
         
        
           | 
           | 
          const Tree *  | 
          targetState,  | 
         
        
           | 
           | 
          Diff &  | 
          diff  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
staticprotected   | 
  
 
 
  
  
      
        
          | std::string cppfs::Tree::m_path | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | std::string cppfs::Tree::m_filename | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | bool cppfs::Tree::m_directory | 
         
       
   | 
  
protected   | 
  
 
'true' if directory, 'false' if file 
 
 
  
  
      
        
          | unsigned int cppfs::Tree::m_size | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | unsigned int cppfs::Tree::m_accessTime | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | unsigned int cppfs::Tree::m_modificationTime | 
         
       
   | 
  
protected   | 
  
 
Time of last modification. 
 
 
  
  
      
        
          | unsigned int cppfs::Tree::m_userId | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | unsigned int cppfs::Tree::m_groupId | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | unsigned long cppfs::Tree::m_permissions | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | std::string cppfs::Tree::m_sha1 | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | std::vector< std::unique_ptr<Tree> > cppfs::Tree::m_children | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: