adbncfs  0.9.1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
FileStatus Class Reference

Keep track of files opened and truncated files. More...

#include <fileInfoCache.h>

Classes

class  Entry
 Represents an entry of FileStatus. More...
 

Public Member Functions

 FileStatus ()
 Default constructor. More...
 
virtual ~FileStatus ()
 Virtual destructor. More...
 
void pendingOpen (const char *pcPath, const bool fPendingOpen, const bool fForWrite)
 Notes that on the given path a read or write operation has been performed. More...
 
void pendingOpen (const char *pcPath, const string &strRenamedFromLocal)
 Transfer existing pending open information to the given path. More...
 
void truncated (const char *pcPath, const bool fTruncated)
 
bool pendingOpen (const char *pcPath) const
 
bool truncated (const char *pcPath) const
 
int flush (const char *pcPath, const string &strFromLocalPath)
 
int release (const char *pcPath, const int iFh)
 

Private Member Functions

 FileStatus (const FileStatus &orig)
 Prevent copy-construction. More...
 
FileStatus operator= (const FileStatus &orig)
 Prevent assignment. More...
 

Private Attributes

map< string, Entrym_Entries
 

Detailed Description

Keep track of files opened and truncated files.

Definition at line 105 of file fileInfoCache.h.

Constructor & Destructor Documentation

FileStatus::FileStatus ( )
inline

Default constructor.

Definition at line 109 of file fileInfoCache.h.

virtual FileStatus::~FileStatus ( )
inlinevirtual

Virtual destructor.

Definition at line 112 of file fileInfoCache.h.

FileStatus::FileStatus ( const FileStatus orig)
private

Prevent copy-construction.

Member Function Documentation

int FileStatus::flush ( const char *  pcPath,
const string &  strFromLocalPath 
)

Definition at line 339 of file fileinfoCache.cpp.

Here is the caller graph for this function:

FileStatus FileStatus::operator= ( const FileStatus orig)
private

Prevent assignment.

void FileStatus::pendingOpen ( const char *  pcPath,
const bool  fPendingOpen,
const bool  fForWrite 
)

Notes that on the given path a read or write operation has been performed.

adbnc_read(() or adbnc_write() call it with fPendingOpen == true to mark the file for being read from or written to.

adbnc_flush() and adbnc_fsync() call it with fPendingOpen == false to indicate that the given file is no longer open for read respectively write operations.

To avoid unnecessary adb push operations is is important to know that a file has never been changed (ie no write took place) since the last adb pull operation. flush() uses this information to decide if a file needs to be pushed back to the android device.

Parameters
pcPathpathname to the file.
fPendingOpenif true indicate a read/write operation has been performed on the file.
fForWriteif true a read operation has been performed on the file, otherwise it was a write operation.

Definition at line 267 of file fileinfoCache.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void FileStatus::pendingOpen ( const char *  pcPath,
const string &  strRenamedFromLocal 
)

Transfer existing pending open information to the given path.

Parameters
pcPathpath to the new name of the file.
strRenamedFromLocalpath to the original name of the file.

Definition at line 287 of file fileinfoCache.cpp.

Here is the call graph for this function:

bool FileStatus::pendingOpen ( const char *  pcPath) const

Definition at line 315 of file fileinfoCache.cpp.

int FileStatus::release ( const char *  pcPath,
const int  iFh 
)

Definition at line 351 of file fileinfoCache.cpp.

Here is the caller graph for this function:

void FileStatus::truncated ( const char *  pcPath,
const bool  fTruncated 
)

Definition at line 301 of file fileinfoCache.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool FileStatus::truncated ( const char *  pcPath) const

Definition at line 327 of file fileinfoCache.cpp.

Member Data Documentation

map<string, Entry> FileStatus::m_Entries
private

Definition at line 166 of file fileInfoCache.h.


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