Overview
Context
Changes
Modified src/Makefile
from [6b94befb31]
to [d9404b9361].
︙ | | |
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
+
|
OFInvocation.m \
OFLHAArchive.m \
OFLHAArchiveEntry.m \
OFList.m \
OFLocale.m \
OFMD5Hash.m \
OFMapTable.m \
OFMemoryStream.m \
OFMessagePackExtension.m \
OFMethodSignature.m \
OFMutableArray.m \
OFMutableData.m \
OFMutableDictionary.m \
OFMutableLHAArchiveEntry.m \
OFMutablePair.m \
|
︙ | | |
Added src/OFMemoryStream.h version [173e3dc728].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008-2022 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFSeekableStream.h"
OF_ASSUME_NONNULL_BEGIN
/**
* @class OFMemoryStream OFMemoryStream.h ObjFW/OFMemoryStream.h
*
* @brief A seekable stream for reading from and writing to memory.
*/
OF_SUBCLASSING_RESTRICTED
@interface OFMemoryStream: OFSeekableStream
{
char *_address;
size_t _size, _position;
bool _writable;
}
/**
* @brief Creates a new OFMemoryStream with the specified memory.
*
* @warning The memory is not copied, so it is your responsibility that the
* specified memory stays alive for as long as the OFMemoryStream does!
*
* @param address The memory address for the stream
* @param size The size of the memory at the specified address
* @param writable Whether writes to memory should be allowed
* @return A new autoreleased OFMemoryStream
*/
+ (instancetype)streamWithMemoryAddress: (void *)address
size: (size_t)size
writable: (bool)writable;
- (instancetype)init OF_UNAVAILABLE;
/**
* @brief Initializes an already allocated OFMemoryStream with the specified
* memory.
*
* @warning The memory is not copied, so it is your responsibility that the
* specified memory stays alive for as long as the OFMemoryStream does!
*
* @param address The memory address for the stream
* @param size The size of the memory at the specified address
* @param writable Whether writes to memory should be allowed
* @return An initialized OFMemoryStream
*/
- (instancetype)initWithMemoryAddress: (void *)address
size: (size_t)size
writable: (bool)writable;
@end
OF_ASSUME_NONNULL_END
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFMemoryStream.m version [99f6625215].