Microsoft Information Protection (MIP) SDK for C++: Reference 1.16
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
editable_stream.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27/**
28 * @brief A file containing the EditableStream interface/class definition.
29 *
30 * @file editable_stream.h
31 */
32
33#ifndef API_MIP_EDITABLE_STREAM_H_
34#define API_MIP_EDITABLE_STREAM_H_
35
36#include "mip/mip_namespace.h"
37#include "mip/stream.h"
38
39MIP_NAMESPACE_BEGIN
40
41class EditableStream : public Stream {
42public:
43 /**
44 * @brief Update a number of bytes in the stream from a buffer.
45 *
46 * @param buffer pointer to a buffer
47 * @param bufferLength buffer size.
48 * @param replaceLength number of bytes to replace.
49 *
50 * @return number of bytes written.
51 *
52 * @note This will seek to the end of the updated section.
53 */
54 virtual int64_t Update(const uint8_t* buffer, int64_t bufferLength, int64_t replaceLength) = 0;
55
56 /**
57 * @brief Delete a number of bytes from the stream.
58 *
59 * @param numBytes number of bytes to delete.
60 *
61 * @return number of bytes deleted.
62 *
63 * @note This will not move the stream position.
64 */
65 virtual int64_t Delete(int64_t numBytes) = 0;
66
67 /**
68 * @brief Insert a buffer into the stream.
69 *
70 * @param buffer pointer to a buffer
71 * @param bufferLength buffer size.
72 *
73 * @return number of bytes written.
74 *
75 * @note This will seek to the end of the inserted section.
76 */
77 virtual int64_t Insert(const uint8_t* buffer, int64_t bufferLength) = 0;
78};
79
80MIP_NAMESPACE_END
81
82#endif // API_MIP_EDITABLE_STREAM_H_
virtual int64_t Insert(const uint8_t *buffer, int64_t bufferLength)=0
Insert a buffer into the stream.
virtual int64_t Update(const uint8_t *buffer, int64_t bufferLength, int64_t replaceLength)=0
Update a number of bytes in the stream from a buffer.
virtual int64_t Delete(int64_t numBytes)=0
Delete a number of bytes from the stream.
A class that defines the interface between the MIP SDK and stream-based content.
Definition stream.h:46
MIP namespace macros.
A file containing the Stream interface/class definition.