Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
08fee9a2
Commit
08fee9a2
authored
Aug 06, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/ForeignFifoBuffer: add method GetAvailable()
parent
f89da178
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
DynamicFifoBuffer.hxx
src/util/DynamicFifoBuffer.hxx
+2
-1
ForeignFifoBuffer.hxx
src/util/ForeignFifoBuffer.hxx
+4
-0
No files found.
src/util/DynamicFifoBuffer.hxx
View file @
08fee9a2
...
...
@@ -54,6 +54,7 @@ public:
using
ForeignFifoBuffer
<
T
>::
IsEmpty
;
using
ForeignFifoBuffer
<
T
>::
IsFull
;
using
ForeignFifoBuffer
<
T
>::
GetAvailable
;
using
ForeignFifoBuffer
<
T
>::
Read
;
using
ForeignFifoBuffer
<
T
>::
Consume
;
using
ForeignFifoBuffer
<
T
>::
Write
;
...
...
@@ -73,7 +74,7 @@ public:
/* we already have enough space */
return
;
const
size_type
in_use
=
Read
().
size
;
const
size_type
in_use
=
GetAvailable
()
;
const
size_type
required_capacity
=
in_use
+
n
;
size_type
new_capacity
=
GetCapacity
();
do
{
...
...
src/util/ForeignFifoBuffer.hxx
View file @
08fee9a2
...
...
@@ -171,6 +171,10 @@ public:
tail
+=
n
;
}
constexpr
size_type
GetAvailable
()
const
{
return
tail
-
head
;
}
/**
* Return a buffer range which may be read. The buffer pointer is
* writable, to allow modifications while parsing.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment