ObjFW  Check-in [83b2a5d5d7]

Overview
Comment:Add a warning to OFStream documentation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 83b2a5d5d77163f303210ac7f9cbf2573f9458e9803e1345e9b15cd817414ff6
User & Date: js on 2010-04-23 14:02:10
Other Links: manifest | tags
Context
2010-04-30
12:56
We can't use isUTF8 here as it might be an OFConstString. check-in: 0166740a39 user: js tags: trunk
2010-04-23
14:02
Add a warning to OFStream documentation. check-in: 83b2a5d5d7 user: js tags: trunk
13:10
Nicer OFList API. check-in: 0ea8e1ef09 user: js tags: trunk
Changes

Modified src/OFStream.h from [a95808e9fd] to [39142061c5].

52
53
54
55
56
57
58



59
60
61
62
63
64
65
66
67
68



69
70
71
72
73
74



75
76
77
78
79
80
81



82
83
84
85
86
87
88



89
90
91
92
93
94
95



96
97
98
99
100
101
102



103
104
105
106
107
108
109



110
111
112
113
114
115
116
117



118
119
120
121
122
123
124

/**
 * Reads exactly size bytes from the stream into a buffer. Unlike
 * readNBytes:intoBuffer:, this method does not return when less than the
 * specified size has been read - instead, it waits until it got exactly size
 * bytes.
 *



 * \param buf The buffer into which the data is read
 * \param size The size of the data that should be read.
 *	       The buffer MUST be EXACTLY this big!
 */
- (void)readExactlyNBytes: (size_t)size
	       intoBuffer: (char*)buf;

/**
 * Reads an uint8_t from the stream.
 *



 * \return An uint8_t from the stream
 */
- (uint8_t)readInt8;

/**
 * Reads an uint16_t from the stream which is encoded in big endian.



 *
 * \return An uint16_t from the stream in native endianess
 */
- (uint16_t)readBigEndianInt16;

/**
 * Reads an uint32_t from the stream which is encoded in big endian.



 *
 * \return An uint32_t from the stream in the native endianess
 */
- (uint32_t)readBigEndianInt32;

/**
 * Reads an uint64_t from the stream which is encoded in big endian.



 *
 * \return An uint64_t from the stream in the native endianess
 */
- (uint64_t)readBigEndianInt64;

/**
 * Reads an uint16_t from the stream which is encoded in little endian.



 *
 * \return An uint16_t from the stream in native endianess
 */
- (uint16_t)readLittleEndianInt16;

/**
 * Reads an uint32_t from the stream which is encoded in little endian.



 *
 * \return An uint32_t from the stream in the native endianess
 */
- (uint32_t)readLittleEndianInt32;

/**
 * Reads an uint64_t from the stream which is encoded in little endian.



 *
 * \return An uint64_t from the stream in the native endianess
 */
- (uint64_t)readLittleEndianInt64;

/**
 * Reads nitems items with the specified item size from the stream and returns
 * them in an OFDataArray.



 *
 * \param itemsize The size of each item
 * \param nitems The number of iteams to read
 * \return An OFDataArray with at nitems items.
 */
- (OFDataArray*)readDataArrayWithItemSize: (size_t)itemsize
				andNItems: (size_t)nitems;







>
>
>










>
>
>






>
>
>







>
>
>







>
>
>







>
>
>







>
>
>







>
>
>








>
>
>







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151

/**
 * Reads exactly size bytes from the stream into a buffer. Unlike
 * readNBytes:intoBuffer:, this method does not return when less than the
 * specified size has been read - instead, it waits until it got exactly size
 * bytes.
 *
 * WARNING: Only call this when you know that specified amount of data is
 *	    available! Otherwise you will get an exception!
 *
 * \param buf The buffer into which the data is read
 * \param size The size of the data that should be read.
 *	       The buffer MUST be EXACTLY this big!
 */
- (void)readExactlyNBytes: (size_t)size
	       intoBuffer: (char*)buf;

/**
 * Reads an uint8_t from the stream.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return An uint8_t from the stream
 */
- (uint8_t)readInt8;

/**
 * Reads an uint16_t from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return An uint16_t from the stream in native endianess
 */
- (uint16_t)readBigEndianInt16;

/**
 * Reads an uint32_t from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return An uint32_t from the stream in the native endianess
 */
- (uint32_t)readBigEndianInt32;

/**
 * Reads an uint64_t from the stream which is encoded in big endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return An uint64_t from the stream in the native endianess
 */
- (uint64_t)readBigEndianInt64;

/**
 * Reads an uint16_t from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return An uint16_t from the stream in native endianess
 */
- (uint16_t)readLittleEndianInt16;

/**
 * Reads an uint32_t from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return An uint32_t from the stream in the native endianess
 */
- (uint32_t)readLittleEndianInt32;

/**
 * Reads an uint64_t from the stream which is encoded in little endian.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \return An uint64_t from the stream in the native endianess
 */
- (uint64_t)readLittleEndianInt64;

/**
 * Reads nitems items with the specified item size from the stream and returns
 * them in an OFDataArray.
 *
 * WARNING: Only call this when you know that enough data is available!
 *	    Otherwise you will get an exception!
 *
 * \param itemsize The size of each item
 * \param nitems The number of iteams to read
 * \return An OFDataArray with at nitems items.
 */
- (OFDataArray*)readDataArrayWithItemSize: (size_t)itemsize
				andNItems: (size_t)nitems;