summaryrefslogtreecommitdiff
path: root/src/ByteArrayDiskWriter.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
commit1b7c1982896dba1d38e1fe84ba9660996607f5f9 (patch)
treed12047cb37ded1e18d4d5b97844412538beb19ff /src/ByteArrayDiskWriter.cc
parentd82e183d346375ac8a58a298a58728be615f947e (diff)
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
Diffstat (limited to 'src/ByteArrayDiskWriter.cc')
-rw-r--r--src/ByteArrayDiskWriter.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/ByteArrayDiskWriter.cc b/src/ByteArrayDiskWriter.cc
index e232ac5b..81dfe8eb 100644
--- a/src/ByteArrayDiskWriter.cc
+++ b/src/ByteArrayDiskWriter.cc
@@ -35,8 +35,9 @@
#include "ByteArrayDiskWriter.h"
#include "Util.h"
-ByteArrayDiskWriter::ByteArrayDiskWriter() {
-}
+namespace aria2 {
+
+ByteArrayDiskWriter::ByteArrayDiskWriter() {}
ByteArrayDiskWriter::~ByteArrayDiskWriter() {}
@@ -45,21 +46,18 @@ void ByteArrayDiskWriter::clear()
buf.str("");
}
-void ByteArrayDiskWriter::initAndOpenFile(const string& filename,
+void ByteArrayDiskWriter::initAndOpenFile(const std::string& filename,
int64_t totalLength)
{
clear();
}
-void ByteArrayDiskWriter::openFile(const string& filename,
- int64_t totalLength)
-{
-}
+void ByteArrayDiskWriter::openFile(const std::string& filename,
+ int64_t totalLength) {}
-void ByteArrayDiskWriter::closeFile()
-{}
+void ByteArrayDiskWriter::closeFile() {}
-void ByteArrayDiskWriter::openExistingFile(const string& filename,
+void ByteArrayDiskWriter::openExistingFile(const std::string& filename,
int64_t totalLength)
{
openFile(filename);
@@ -68,20 +66,22 @@ void ByteArrayDiskWriter::openExistingFile(const string& filename,
void ByteArrayDiskWriter::writeData(const unsigned char* data, int32_t dataLength, int64_t position)
{
if(size() < position) {
- buf.seekp(size(), ios::beg);
+ buf.seekp(size(), std::ios::beg);
for(int64_t i = size(); i < position; ++i) {
buf.put('\0');
}
} else {
- buf.seekp(position, ios::beg);
+ buf.seekp(position, std::ios::beg);
}
buf.write(reinterpret_cast<const char*>(data), dataLength);
}
int32_t ByteArrayDiskWriter::readData(unsigned char* data, int32_t len, int64_t position)
{
- buf.seekg(position, ios::beg);
+ buf.seekg(position, std::ios::beg);
buf.read(reinterpret_cast<char*>(data), len);
buf.clear();
return buf.gcount();
}
+
+} // namespace aria2