TestResourceManager.h
Go to the documentation of this file.
147 TRMFileHandle TRMCreateFile(const char *pFileName, SemihostingFileMode mode); //Returns 0 on failure.
226 TRMReadBurstHandle TRMBeginReadBurst(TRMFileHandle hFile, void *pWorkArea, size_t workAreaSize);
281 ssize_t TRMReadFileCached(TRMReadBurstHandle hBurst, void *pBuffer, size_t size, int allowPartialReads);
TRMErrorCode TRMDeleteDirectory(const char *pDirName, int recursively)
Deletes a file.
Definition: TestResourceManager.cpp:123
ssize_t TRMWriteFile(TRMFileHandle hFile, const void *pBuffer, size_t size)
Write the data to a file on the host machine.
Definition: TestResourceManager.cpp:88
Definition: TestResourceManager.h:127
TRMFileHandle TRMCreateFile(const char *pFileName, SemihostingFileMode mode)
Creates or opens a file on the host.
Definition: TestResourceManager.cpp:71
SemihostingFileMode
Lists the supported file open modes.
Definition: TestResourceManager.h:105
TRMErrorCode TRMDeleteFile(const char *pFileName)
Deletes a file.
Definition: TestResourceManager.cpp:111
Create an empty file if it doesn't exist. Otherwise, truncate an existing file. Allow writing to the ...
Definition: TestResourceManager.h:108
TRMErrorCode TRMCreateDirectory(const char *pDirName)
Creates a subdirectory.
Definition: TestResourceManager.cpp:117
Open an existing file and allow reading/writing it. If the file doesn't exist, create it...
Definition: TestResourceManager.h:114
uint64_t TRMGetFileSize(TRMFileHandle hFile)
Returns the size of the file.
Definition: TestResourceManager.cpp:94
uint64_t TRMSeekFile(TRMFileHandle hFile, int mode, int64_t distance)
Moves the file pointer.
Definition: TestResourceManager.cpp:100
TRMErrorCode TRMEndWriteBurst(TRMWriteBurstHandle hBurst)
Ends a write burst.
Definition: TestResourceManager.cpp:272
ssize_t TRMReadFileCached(TRMReadBurstHandle hBurst, void *pBuffer, size_t size, int allowPartialReads)
Reads data within a read burst.
Definition: TestResourceManager.cpp:236
TRMWriteBurstHandle TRMBeginWriteBurst(TRMFileHandle hFile)
Starts a read burst.
Definition: TestResourceManager.cpp:266
uint64_t TRMGetHostSystemTime()
Returns system time on host in Windows FILETIME format.
Definition: TestResourceManager.cpp:65
TRMErrorCode TRMEndReadFileCached(TRMReadBurstHandle hBurst, void *pBuffer, size_t size)
Releases the buffer returned by TRMBeginReadFileCached.
Definition: TestResourceManager.cpp:208
void * TRMBeginReadFileCached(TRMReadBurstHandle hBurst, size_t *pSize, int waitForData)
Returns the pointer to a block of data that has been prefetched into the read burst buffer...
Definition: TestResourceManager.cpp:170
Definition: TestResourceManager.h:125
struct tagTRMReadBurstHandle * TRMReadBurstHandle
Definition: TestResourceManager.h:131
Create an empty file if it doesn't exist. Otherwise, truncate an existing file. Allow reading to the ...
Definition: TestResourceManager.h:116
TRMErrorCode
Specifies the error code returned by common Test Resource Manager functions.
Definition: TestResourceManager.h:123
Definition: TestResourceManager.h:126
ssize_t TRMWriteFileCached(TRMWriteBurstHandle hBurst, const void *pData, size_t size)
Writes data within a write burst.
Definition: TestResourceManager.cpp:278
void TRMCloseFile(TRMFileHandle hFile)
Closes a handle returned by TRMCreateFile.
Definition: TestResourceManager.cpp:77
Create an empty file if it doesn't exist. Otherwise, open the existing file and immediately seek to t...
Definition: TestResourceManager.h:110
struct tagTRMWriteBurstHandle * TRMWriteBurstHandle
Definition: TestResourceManager.h:132
Open an existing file in read-only mode. If the file doesn't exist, TRMCreateFile will return 0...
Definition: TestResourceManager.h:112
ssize_t TRMReadFile(TRMFileHandle hFile, void *pBuffer, size_t size)
Reads the data from a file on the host machine.
Definition: TestResourceManager.cpp:82
TRMErrorCode TRMEndReadBurst(TRMReadBurstHandle hBurst)
Ends a read burst.
Definition: TestResourceManager.cpp:157
void TRMTruncateFile(TRMFileHandle hFile)
Truncates the file.
Definition: TestResourceManager.cpp:106
TRMReadBurstHandle TRMBeginReadBurst(TRMFileHandle hFile, void *pWorkArea, size_t workAreaSize)
Starts a read burst.
Definition: TestResourceManager.cpp:136