2000-05-18 21:25:51 +00:00
|
|
|
/*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-05-18 21:25:51 +00:00
|
|
|
*
|
2004-05-18 22:01:41 +00:00
|
|
|
* Copyright (C) 1997-2004, International Business Machines
|
2000-05-18 21:25:51 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-05-18 21:25:51 +00:00
|
|
|
*
|
|
|
|
* File UMEMSTRM.H
|
|
|
|
*
|
|
|
|
* Contains UMemoryStream interface
|
|
|
|
*
|
|
|
|
* @author Vladimir Weinstein
|
|
|
|
*
|
|
|
|
* Modification History:
|
|
|
|
*
|
|
|
|
* Date Name Description
|
|
|
|
* 5/17/00 weiv Created.
|
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-05-18 21:25:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef UMEMSTRM_H
|
|
|
|
#define UMEMSTRM_H
|
|
|
|
|
|
|
|
#ifndef _UTYPES
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct UMemoryStream;
|
|
|
|
|
|
|
|
typedef struct UMemoryStream UMemoryStream;
|
|
|
|
|
|
|
|
struct UMemoryStream{
|
|
|
|
uint8_t *fStart;
|
|
|
|
int32_t fSize;
|
|
|
|
int32_t fPos;
|
|
|
|
int32_t fReadPos;
|
2000-05-18 22:08:39 +00:00
|
|
|
UBool fReadOnly;
|
|
|
|
UBool fError;
|
2000-05-22 19:50:23 +00:00
|
|
|
UBool fEof;
|
2000-05-18 21:25:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
U_CAPI UMemoryStream * U_EXPORT2 uprv_mstrm_openNew(int32_t size);
|
2000-05-24 19:58:40 +00:00
|
|
|
U_CAPI UMemoryStream * U_EXPORT2 uprv_mstrm_openBuffer(const uint8_t *buffer, int32_t len);
|
2000-05-18 21:25:51 +00:00
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_close(UMemoryStream *MS);
|
2000-05-18 22:08:39 +00:00
|
|
|
U_CAPI UBool U_EXPORT2 uprv_mstrm_setError(UMemoryStream *MS);
|
2004-03-27 07:21:32 +00:00
|
|
|
U_CAPI UBool U_EXPORT2 uprv_mstrm_error(const UMemoryStream *MS);
|
|
|
|
U_CAPI UBool U_EXPORT2 uprv_mstrm_eof(const UMemoryStream *MS);
|
2000-05-18 21:25:51 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2 uprv_mstrm_read(UMemoryStream *MS, void* addr, int32_t len);
|
2000-11-06 23:58:15 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2 uprv_mstrm_write(UMemoryStream *MS, const void *buffer, int32_t len);
|
2004-03-27 07:21:32 +00:00
|
|
|
U_CAPI const uint8_t * U_EXPORT2 uprv_mstrm_getBuffer(const UMemoryStream *MS, int32_t *len);
|
|
|
|
U_CAPI const uint8_t * U_EXPORT2 uprv_mstrm_getCurrentBuffer(const UMemoryStream *MS, int32_t *len);
|
2000-11-07 16:32:42 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2 uprv_mstrm_skip(UMemoryStream *MS, int32_t len);
|
|
|
|
U_CAPI int32_t U_EXPORT2 uprv_mstrm_jump(UMemoryStream *MS, const uint8_t *where);
|
2000-05-18 21:25:51 +00:00
|
|
|
|
2000-11-06 23:58:15 +00:00
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_write8(UMemoryStream *MS, uint8_t byte);
|
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_write16(UMemoryStream *MS, uint16_t word);
|
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_write32(UMemoryStream *MS, uint32_t wyde);
|
2002-03-12 01:32:42 +00:00
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_writeBlock(UMemoryStream *MS, const void *s, int32_t length);
|
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_writePadding(UMemoryStream *MS, int32_t length);
|
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_writeString(UMemoryStream *MS, const char *s, int32_t length);
|
|
|
|
U_CAPI void U_EXPORT2 uprv_mstrm_writeUString(UMemoryStream *MS, const UChar *s, int32_t length);
|
2000-11-06 23:58:15 +00:00
|
|
|
|
2000-05-18 21:25:51 +00:00
|
|
|
#endif /* _FILESTRM*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|