Apache Log4cxx
Version 2.0.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
struct
ByteBufferPriv;
30
41
class
LOG4CXX_EXPORT
ByteBuffer
42
{
43
private
:
44
LOG4CXX_DECLARE_PRIVATE_MEMBER(std::unique_ptr<ByteBufferPriv>, m_priv);
45
46
public
:
48
ByteBuffer
(
char
*
data
,
size_t
capacity);
49
~ByteBuffer
();
50
53
void
carry
();
54
57
void
clear
();
58
61
void
flip
();
62
64
char
*
data
();
66
const
char
*
data
()
const
;
67
69
char
*
current
();
71
const
char
*
current
()
const
;
72
76
size_t
limit
()
const
;
77
78
80
size_t
position
()
const
;
81
84
size_t
remaining
()
const
;
85
90
size_t
increment_position
(
size_t
byteCount);
91
95
bool
put
(
char
byteValue);
96
98
ByteBufferPriv&
impl
();
99
private
:
100
ByteBuffer
(
const
ByteBuffer
&);
101
ByteBuffer
& operator=(
const
ByteBuffer
&);
102
};
103
}
// namespace helpers
104
105
}
//namespace log4cxx
106
107
#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::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::impl
ByteBufferPriv & impl()
Internal use only.
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::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.18.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
.