mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #510 Remove underscores from all the source file names
This commit is contained in:
38
src/plugins/simulator/fs9/multiplayerpacketparser.cpp
Normal file
38
src/plugins/simulator/fs9/multiplayerpacketparser.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/* Copyright (C) 2014
|
||||
* swift project community / contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
#include "multiplayerpacketparser.h"
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fs9
|
||||
{
|
||||
namespace Private
|
||||
{
|
||||
QByteArray readValue(const QByteArray &data, QString &val)
|
||||
{
|
||||
val = QString(data);
|
||||
|
||||
// Up to know all packets with string data, had the string payload at the end
|
||||
// of the packet. Therefore there should not be any data after the string.
|
||||
// Remove the assert, if this will change in the future.
|
||||
QByteArray leftOver = data.mid(val.size() + 1);
|
||||
Q_ASSERT(leftOver.isEmpty());
|
||||
|
||||
return leftOver;
|
||||
}
|
||||
|
||||
QByteArray writeValue(QByteArray data, const QString &value)
|
||||
{
|
||||
data.append(qPrintable(value));
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user