Apache Log4cxx
Version 1.8.0
Toggle main menu visibility
Loading...
Searching...
No Matches
bytebuffer.h
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#ifndef _LOG4CXX_HELPERS_BYTEBUFFER_H
19
#define _LOG4CXX_HELPERS_BYTEBUFFER_H
20
21
#include <log4cxx/log4cxx.h>
22
#include <stdio.h>
23
24
namespace
LOG4CXX_NS
25
{
26
27
namespace
helpers
28
{
29
40
class
LOG4CXX_EXPORT
ByteBuffer
41
{
42
private
:
43
LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ByteBufferPriv, m_priv)
44
45
public
:
47
ByteBuffer
(
char
*
data
,
size_t
capacity);
48
~ByteBuffer
();
49
52
void
carry
();
53
56
void
clear
();
57
60
void
flip
();
61
63
char
*
data
();
65
const
char
*
data
()
const
;
66
68
char
*
current
();
70
const
char
*
current
()
const
;
71
75
size_t
limit
()
const
;
76
77
#if LOG4CXX_ABI_VERSION <= 15
83
[[ deprecated(
"Use flip instead"
) ]]
84
void
limit
(
size_t
newLimit);
85
#endif
86
88
size_t
position
()
const
;
89
92
size_t
remaining
()
const
;
93
94
#if LOG4CXX_ABI_VERSION <= 15
99
[[ deprecated(
"Use increment_position instead"
) ]]
100
void
position
(
size_t
newPosition);
101
#endif
106
size_t
increment_position
(
size_t
byteCount);
107
111
bool
put
(
char
byteValue);
112
113
114
private
:
115
ByteBuffer
(
const
ByteBuffer
&);
116
ByteBuffer
& operator=(
const
ByteBuffer
&);
117
};
118
}
// namespace helpers
119
120
}
//namespace log4cxx
121
122
#endif
//_LOG4CXX_HELPERS_BYTEBUFFER_H
log4cxx::helpers::ByteBuffer::position
size_t position() const
The offset of the current cursor from the start of the memory area.
log4cxx::helpers::ByteBuffer::clear
void clear()
Set the cursor to the start of the memory area and use the capacity as the extent to which the cursor...
log4cxx::helpers::ByteBuffer::put
bool put(char byteValue)
Store byteValue at the cursor position and advance the cursor position unless the cursor cannot advan...
log4cxx::helpers::ByteBuffer::remaining
size_t remaining() const
The number of bytes from the current cursor until the cursor can no longer advance.
log4cxx::helpers::ByteBuffer::data
const char * data() const
The start of the memory area.
log4cxx::helpers::ByteBuffer::increment_position
size_t increment_position(size_t byteCount)
Advance the cursor by byteCount if that does not exceed the extent to which the cursor can advance,...
log4cxx::helpers::ByteBuffer::limit
void limit(size_t newLimit)
Use newLimit as the extent to which the cursor can advance.
log4cxx::helpers::ByteBuffer::current
char * current()
The memory at the cursor position.
log4cxx::helpers::ByteBuffer::~ByteBuffer
~ByteBuffer()
log4cxx::helpers::ByteBuffer::limit
size_t limit() const
The extent to which the cursor can advance as an offset from the start of the memory area.
log4cxx::helpers::ByteBuffer::current
const char * current() const
The memory at the cursor position.
log4cxx::helpers::ByteBuffer::ByteBuffer
ByteBuffer(char *data, size_t capacity)
A capacity sized area of memory at data.
log4cxx::helpers::ByteBuffer::position
void position(size_t newPosition)
Use newPosition as the cursor position providing it is less than the extent to which the cursor can a...
log4cxx::helpers::ByteBuffer::flip
void flip()
Set the extent to which the cursor can advance, limit(), to the current cursor position and move the ...
log4cxx::helpers::ByteBuffer::data
char * data()
The start of the memory area.
log4cxx::helpers::ByteBuffer::carry
void carry()
Move the remaining bytes to the start of the memory area and set the cursor to the end of the those b...
src
main
include
log4cxx
helpers
bytebuffer.h
Generated by
1.17.0 on
SITE_PUBLISHED_DATE
Copyright © 2017-2026
Apache Software Foundation
. Apache, Chainsaw, log4cxx, Log4j, Log4net, log4php and the Apache logo are
trademarks or registered trademarks
of The Apache Software Foundation.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Privacy Policy
.