summaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-11-10 19:24:33 +0100
committerMax Kellermann <max@musicpd.org>2017-11-10 19:24:33 +0100
commit49784513b13ae8c5a5811fab8439463964a9e151 (patch)
tree7c2bd603ff23a4cab138b38a15e2892588621dfd /src/fs
parent523051132d77cb5da01847592c4c1e1faae93c6a (diff)
util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/io/BufferedOutputStream.cxx6
-rw-r--r--src/fs/io/BufferedReader.cxx10
-rw-r--r--src/fs/io/GunzipReader.cxx4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/fs/io/BufferedOutputStream.cxx b/src/fs/io/BufferedOutputStream.cxx
index 338210070..def68081e 100644
--- a/src/fs/io/BufferedOutputStream.cxx
+++ b/src/fs/io/BufferedOutputStream.cxx
@@ -70,7 +70,7 @@ void
BufferedOutputStream::Format(const char *fmt, ...)
{
auto r = buffer.Write();
- if (r.IsEmpty()) {
+ if (r.empty()) {
Flush();
r = buffer.Write();
}
@@ -123,7 +123,7 @@ BufferedOutputStream::WriteWideToUTF8(const wchar_t *src, size_t src_length)
return;
auto r = buffer.Write();
- if (r.IsEmpty()) {
+ if (r.empty()) {
Flush();
r = buffer.Write();
}
@@ -158,7 +158,7 @@ void
BufferedOutputStream::Flush()
{
auto r = buffer.Read();
- if (r.IsEmpty())
+ if (r.empty())
return;
os.Write(r.data, r.size);
diff --git a/src/fs/io/BufferedReader.cxx b/src/fs/io/BufferedReader.cxx
index f3095ca93..8d4cb528b 100644
--- a/src/fs/io/BufferedReader.cxx
+++ b/src/fs/io/BufferedReader.cxx
@@ -34,13 +34,13 @@ BufferedReader::Fill(bool need_more)
return !need_more;
auto w = buffer.Write();
- if (w.IsEmpty()) {
+ if (w.empty()) {
if (buffer.GetCapacity() >= MAX_SIZE)
return !need_more;
buffer.Grow(buffer.GetCapacity() * 2);
w = buffer.Write();
- assert(!w.IsEmpty());
+ assert(!w.empty());
}
size_t nbytes = reader.Read(w.data, w.size);
@@ -104,14 +104,14 @@ BufferedReader::ReadLine()
}
} while (Fill(true));
- if (!eof || buffer.IsEmpty())
+ if (!eof || buffer.empty())
return nullptr;
auto w = buffer.Write();
- if (w.IsEmpty()) {
+ if (w.empty()) {
buffer.Grow(buffer.GetCapacity() + 1);
w = buffer.Write();
- assert(!w.IsEmpty());
+ assert(!w.empty());
}
/* terminate the last line */
diff --git a/src/fs/io/GunzipReader.cxx b/src/fs/io/GunzipReader.cxx
index ffad13fd1..f8a1a7e9b 100644
--- a/src/fs/io/GunzipReader.cxx
+++ b/src/fs/io/GunzipReader.cxx
@@ -39,7 +39,7 @@ inline bool
GunzipReader::FillBuffer()
{
auto w = buffer.Write();
- assert(!w.IsEmpty());
+ assert(!w.empty());
size_t nbytes = next.Read(w.data, w.size);
if (nbytes == 0)
@@ -62,7 +62,7 @@ GunzipReader::Read(void *data, size_t size)
int flush = Z_NO_FLUSH;
auto r = buffer.Read();
- if (r.IsEmpty()) {
+ if (r.empty()) {
if (FillBuffer())
r = buffer.Read();
else