diff options
Diffstat (limited to 'src/server/shared/Packets/ByteBuffer.cpp')
-rw-r--r-- | src/server/shared/Packets/ByteBuffer.cpp | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp deleted file mode 100644 index 0a5823cc67..0000000000 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) - * Copyright (C) - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "ByteBuffer.h" -#include "Common.h" -#include "Log.h" - -#include <ace/Stack_Trace.h> -#include <sstream> - -ByteBufferPositionException::ByteBufferPositionException(bool add, size_t pos, - size_t size, size_t valueSize) -{ - std::ostringstream ss; - - ss << "Attempted to " << (add ? "put" : "get") << " value with size: " - << valueSize << " in ByteBuffer (pos: " << pos << " size: " << size - << ")"; - - message().assign(ss.str()); -} - -ByteBufferSourceException::ByteBufferSourceException(size_t pos, size_t size, - size_t valueSize) -{ - std::ostringstream ss; - - ss << "Attempted to put a " - << (valueSize > 0 ? "NULL-pointer" : "zero-sized value") - << " in ByteBuffer (pos: " << pos << " size: " << size << ")"; - - message().assign(ss.str()); -} - -void ByteBuffer::hexlike(bool outString) const -{ - if (!outString) - return; - - uint32 j = 1, k = 1; - - std::ostringstream o; - o << "STORAGE_SIZE: " << size() << "\nCONTENTS:\n"; - - for (uint32 i = 0; i < size(); ++i) - { - char buf[3]; - snprintf(buf, 3, "%02X", read<uint8>(i)); - if ((i == (j * 8)) && ((i != (k * 16)))) - { - o << "| "; - ++j; - } - else if (i == (k * 16)) - { - o << "\n"; - ++k; - ++j; - } - - o << buf << " "; - } - o << " "; - - sLog->outString("%s", o.str().c_str()); -} |