LLVFile Class Reference

#include <llvfile.h>

Collaboration diagram for LLVFile:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LLVFile (LLVFS *vfs, const LLUUID &file_id, const LLAssetType::EType file_type, S32 mode=LLVFile::READ)
 ~LLVFile ()
BOOL read (U8 *buffer, S32 bytes, BOOL async=FALSE, F32 priority=128.f)
void setReadPriority (const F32 priority)
BOOL isReadComplete ()
S32 getLastBytesRead ()
BOOL eof ()
BOOL write (const U8 *buffer, S32 bytes)
BOOL seek (S32 offset, S32 origin=-1)
S32 tell () const
S32 getSize ()
S32 getMaxSize ()
BOOL setMaxSize (S32 size)
BOOL rename (const LLUUID &new_id, const LLAssetType::EType new_type)
BOOL remove ()
bool isLocked (EVFSLock lock)
void waitForLock (EVFSLock lock)

Static Public Member Functions

static U8readFile (LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S32 *bytes_read=0)
static BOOL writeFile (const U8 *buffer, S32 bytes, LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type)
static void initClass (LLVFSThread *vfsthread=NULL)
static void cleanupClass ()
static LLVFSThreadgetVFSThread ()

Static Public Attributes

static const S32 READ = 0x00000001
static const S32 WRITE = 0x00000002
static const S32 READ_WRITE = 0x00000003
static const S32 APPEND = 0x00000006

Protected Member Functions

U32 threadPri ()

Protected Attributes

LLAssetType::EType mFileType
LLUUID mFileID
S32 mPosition
S32 mMode
LLVFSmVFS
F32 mPriority
BOOL mOnReadQueue
S32 mBytesRead
LLVFSThread::handle_t mHandle

Static Protected Attributes

static LLVFSThreadsVFSThread = NULL
static BOOL sAllocdVFSThread = FALSE


Detailed Description

Definition at line 40 of file llvfile.h.


Constructor & Destructor Documentation

LLVFile::LLVFile ( LLVFS vfs,
const LLUUID file_id,
const LLAssetType::EType  file_type,
S32  mode = LLVFile::READ 
)

Definition at line 52 of file llvfile.cpp.

References LLVFS::incLock(), mBytesRead, mFileID, mFileType, mHandle, mMode, mPosition, mPriority, mVFS, LLQueuedThread::nullHandle(), and VFSLOCK_OPEN.

Here is the call graph for this function:

LLVFile::~LLVFile (  ) 


Member Function Documentation

BOOL LLVFile::read ( U8 buffer,
S32  bytes,
BOOL  async = FALSE,
F32  priority = 128.f 
)

U8 * LLVFile::readFile ( LLVFS vfs,
const LLUUID uuid,
LLAssetType::EType  type,
S32 bytes_read = 0 
) [static]

Definition at line 128 of file llvfile.cpp.

References getLastBytesRead(), getSize(), NULL, read(), READ, and S32.

Referenced by LLTexLayerSetBuffer::readBackAndUpload().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLVFile::setReadPriority ( const F32  priority  ) 

Definition at line 157 of file llvfile.cpp.

References mHandle, mPriority, LLQueuedThread::nullHandle(), LLQueuedThread::setPriority(), sVFSThread, and threadPri().

Here is the call graph for this function:

BOOL LLVFile::isReadComplete (  ) 

S32 LLVFile::getLastBytesRead (  ) 

BOOL LLVFile::eof (  ) 

Definition at line 193 of file llvfile.cpp.

References getSize(), and mPosition.

Referenced by LLXfer_VFile::suck().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLVFile::write ( const U8 buffer,
S32  bytes 
)

BOOL LLVFile::writeFile ( const U8 buffer,
S32  bytes,
LLVFS vfs,
const LLUUID uuid,
LLAssetType::EType  type 
) [static]

Definition at line 245 of file llvfile.cpp.

References setMaxSize(), write(), and WRITE.

Referenced by LLFloaterAuction::onClickSnapshot(), LLTexLayerSetBuffer::readBackAndUpload(), LLSnapshotLivePreview::saveTexture(), LLFloaterPostcard::sendPostcard(), and LLFloaterReporter::takeScreenshot().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLVFile::seek ( S32  offset,
S32  origin = -1 
)

Definition at line 252 of file llvfile.cpp.

References APPEND, FALSE, getSize(), llendl, llwarns, mMode, mPosition, S32, and TRUE.

Referenced by LLXfer_VFile::suck(), and vfs_seek().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLVFile::tell (  )  const

Definition at line 288 of file llvfile.cpp.

References mPosition.

Referenced by LLHTTPAssetStorage::curlUpCallback(), LLHTTPAssetRequest::readCompressedData(), and vfs_tell().

Here is the caller graph for this function:

S32 LLVFile::getSize (  ) 

S32 LLVFile::getMaxSize (  ) 

Definition at line 301 of file llvfile.cpp.

References LLVFS::getMaxSize(), mFileID, mFileType, mVFS, and S32.

Here is the call graph for this function:

BOOL LLVFile::setMaxSize ( S32  size  ) 

BOOL LLVFile::rename ( const LLUUID new_id,
const LLAssetType::EType  new_type 
)

Definition at line 337 of file llvfile.cpp.

References LLVFS::decLock(), FALSE, LLVFS::incLock(), llendl, llwarns, mFileID, mFileType, mHandle, mMode, mVFS, LLQueuedThread::nullHandle(), LLVFS::renameFile(), TRUE, VFSLOCK_APPEND, VFSLOCK_OPEN, VFSLOCK_READ, waitForLock(), and WRITE.

Referenced by LLHTTPAssetStorage::checkForTimeouts(), and LLXfer_VFile::processEOF().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLVFile::remove (  ) 

bool LLVFile::isLocked ( EVFSLock  lock  ) 

Definition at line 420 of file llvfile.cpp.

References LLVFS::isLocked(), mFileID, mFileType, and mVFS.

Referenced by waitForLock().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLVFile::waitForLock ( EVFSLock  lock  ) 

Definition at line 425 of file llvfile.cpp.

References LLFastTimer::FTM_VFILE_WAIT, isLocked(), LLThread::isPaused(), ms_sleep(), sVFSThread, and LLQueuedThread::update().

Referenced by getSize(), read(), remove(), rename(), and write().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLVFile::initClass ( LLVFSThread vfsthread = NULL  )  [static]

Definition at line 393 of file llvfile.cpp.

References NULL, sAllocdVFSThread, LLVFSThread::sLocal, sVFSThread, and TRUE.

Referenced by LLAppViewer::initCache().

Here is the caller graph for this function:

void LLVFile::cleanupClass (  )  [static]

Definition at line 411 of file llvfile.cpp.

References NULL, sAllocdVFSThread, and sVFSThread.

Referenced by LLAppViewer::cleanup().

Here is the caller graph for this function:

static LLVFSThread* LLVFile::getVFSThread (  )  [inline, static]

Definition at line 69 of file llvfile.h.

References sVFSThread.

Referenced by update_statistics().

Here is the caller graph for this function:

U32 LLVFile::threadPri (  )  [inline, protected]

Definition at line 74 of file llvfile.h.

References llmin(), mPriority, and LLQueuedThread::PRIORITY_NORMAL.

Referenced by read(), and setReadPriority().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

LLVFSThread * LLVFile::sVFSThread = NULL [static, protected]

BOOL LLVFile::sAllocdVFSThread = FALSE [static, protected]

Definition at line 73 of file llvfile.h.

Referenced by cleanupClass(), and initClass().

const S32 LLVFile::READ = 0x00000001 [static]

const S32 LLVFile::WRITE = 0x00000002 [static]

const S32 LLVFile::READ_WRITE = 0x00000003 [static]

Definition at line 79 of file llvfile.h.

const S32 LLVFile::APPEND = 0x00000006 [static]

Definition at line 83 of file llvfile.h.

Referenced by getMaxSize(), getSize(), isLocked(), LLVFile(), read(), remove(), rename(), setMaxSize(), write(), and ~LLVFile().

LLUUID LLVFile::mFileID [protected]

Definition at line 85 of file llvfile.h.

Referenced by getMaxSize(), getSize(), isLocked(), LLVFile(), read(), remove(), rename(), setMaxSize(), write(), and ~LLVFile().

S32 LLVFile::mPosition [protected]

Definition at line 86 of file llvfile.h.

Referenced by eof(), isReadComplete(), LLVFile(), read(), remove(), seek(), tell(), and write().

S32 LLVFile::mMode [protected]

Definition at line 87 of file llvfile.h.

Referenced by LLVFile(), read(), remove(), rename(), seek(), setMaxSize(), write(), and ~LLVFile().

LLVFS* LLVFile::mVFS [protected]

Definition at line 88 of file llvfile.h.

Referenced by getMaxSize(), getSize(), isLocked(), LLVFile(), read(), remove(), rename(), setMaxSize(), write(), and ~LLVFile().

F32 LLVFile::mPriority [protected]

Definition at line 89 of file llvfile.h.

Referenced by LLVFile(), read(), setReadPriority(), and threadPri().

Definition at line 90 of file llvfile.h.

S32 LLVFile::mBytesRead [protected]

Definition at line 92 of file llvfile.h.

Referenced by getLastBytesRead(), isReadComplete(), LLVFile(), and read().

Definition at line 93 of file llvfile.h.

Referenced by isReadComplete(), LLVFile(), read(), remove(), rename(), setReadPriority(), write(), and ~LLVFile().


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

Generated on Fri May 16 09:22:21 2008 for SecondLife by  doxygen 1.5.5