00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef UMEMSTRM_H
00024 #define UMEMSTRM_H
00025
00026 #ifndef _UTYPES
00027 #include "unicode/utypes.h"
00028 #endif
00029
00030 struct UMemoryStream;
00031
00032 typedef struct UMemoryStream UMemoryStream;
00033
00034 struct UMemoryStream{
00035 uint8_t *fStart;
00036 int32_t fSize;
00037 int32_t fPos;
00038 int32_t fReadPos;
00039 UBool fReadOnly;
00040 UBool fError;
00041 UBool fEof;
00042 };
00043
00044 U_CAPI UMemoryStream * U_EXPORT2 uprv_mstrm_openNew(int32_t size);
00045 U_CAPI UMemoryStream * U_EXPORT2 uprv_mstrm_openBuffer(const uint8_t *buffer, int32_t len);
00046 U_CAPI void U_EXPORT2 uprv_mstrm_close(UMemoryStream *MS);
00047 U_CAPI UBool U_EXPORT2 uprv_mstrm_setError(UMemoryStream *MS);
00048 U_CAPI UBool U_EXPORT2 uprv_mstrm_error(UMemoryStream *MS);
00049 U_CAPI UBool U_EXPORT2 uprv_mstrm_eof(UMemoryStream *MS);
00050 U_CAPI int32_t U_EXPORT2 uprv_mstrm_read(UMemoryStream *MS, void* addr, int32_t len);
00051 U_CAPI int32_t U_EXPORT2 uprv_mstrm_write(UMemoryStream *MS, const void *buffer, int32_t len);
00052 U_CAPI const uint8_t * U_EXPORT2 uprv_mstrm_getBuffer(UMemoryStream *MS, int32_t *len);
00053 U_CAPI const uint8_t * U_EXPORT2 uprv_mstrm_getCurrentBuffer(UMemoryStream *MS, int32_t *len);
00054 U_CAPI int32_t U_EXPORT2 uprv_mstrm_skip(UMemoryStream *MS, int32_t len);
00055 U_CAPI int32_t U_EXPORT2 uprv_mstrm_jump(UMemoryStream *MS, const uint8_t *where);
00056
00057 U_CAPI void U_EXPORT2 uprv_mstrm_write8(UMemoryStream *MS, uint8_t byte);
00058 U_CAPI void U_EXPORT2 uprv_mstrm_write16(UMemoryStream *MS, uint16_t word);
00059 U_CAPI void U_EXPORT2 uprv_mstrm_write32(UMemoryStream *MS, uint32_t wyde);
00060 U_CAPI void U_EXPORT2 uprv_mstrm_writeBlock(UMemoryStream *MS, const void *s, UTextOffset length);
00061 U_CAPI void U_EXPORT2 uprv_mstrm_writePadding(UMemoryStream *MS, UTextOffset length);
00062 U_CAPI void U_EXPORT2 uprv_mstrm_writeString(UMemoryStream *MS, const char *s, UTextOffset length);
00063 U_CAPI void U_EXPORT2 uprv_mstrm_writeUString(UMemoryStream *MS, const UChar *s, UTextOffset length);
00064
00065 #endif
00066
00067
00068
00069