1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Use nested namespaces definition syntax

This commit is contained in:
Vladimir Golovnev (Glassez) 2021-01-03 16:53:24 +03:00
parent 04a9ce6e81
commit 552ff0489d
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
10 changed files with 196 additions and 226 deletions

View File

@ -33,9 +33,7 @@
class QByteArray;
namespace Utils
{
namespace ByteArray
namespace Utils::ByteArray
{
// Mimic QString::splitRef(sep, behavior)
QVector<QByteArray> splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior = QString::KeepEmptyParts);
@ -44,4 +42,3 @@ namespace Utils
// we only return a partial view
const QByteArray midView(const QByteArray &in, int pos, int len = -1);
}
}

View File

@ -33,9 +33,7 @@
#include "base/utils/version.h"
namespace Utils
{
namespace ForeignApps
namespace Utils::ForeignApps
{
struct PythonInfo
{
@ -50,4 +48,3 @@ namespace Utils
PythonInfo pythonInfo();
}
}

View File

@ -34,9 +34,7 @@
#include <QString>
namespace Utils
{
namespace Fs
namespace Utils::Fs
{
/**
* Converts a path to a string suitable for display.
@ -77,4 +75,3 @@ namespace Utils
bool isNetworkFileSystem(const QString &path);
#endif
}
}

View File

@ -31,11 +31,8 @@
class QByteArray;
namespace Utils
{
namespace Gzip
namespace Utils::Gzip
{
QByteArray compress(const QByteArray &data, int level = 6, bool *ok = nullptr);
QByteArray decompress(const QByteArray &data, bool *ok = nullptr);
}
}

View File

@ -34,9 +34,7 @@
class QByteArray;
class QFileDevice;
namespace Utils
{
namespace IO
namespace Utils::IO
{
// A wrapper class that satisfy LegacyOutputIterator requirement
class FileDeviceOutputIterator
@ -77,4 +75,3 @@ namespace Utils
int m_bufferSize;
};
}
}

View File

@ -41,9 +41,7 @@ enum class ShutdownDialogAction;
/* Miscellaneous functions that can be useful */
namespace Utils
{
namespace Misc
namespace Utils::Misc
{
// use binary prefix standards from IEC 60027-2
// see http://en.wikipedia.org/wiki/Kilobyte
@ -106,4 +104,3 @@ namespace Utils
}
#endif // Q_OS_WIN
}
}

View File

@ -35,9 +35,7 @@ class QSslCertificate;
class QSslKey;
class QString;
namespace Utils
{
namespace Net
namespace Utils::Net
{
using Subnet = QPair<QHostAddress, int>;
@ -55,4 +53,3 @@ namespace Utils
QSslKey loadSSLKey(const QByteArray &data);
bool isSSLKeyValid(const QByteArray &data);
}
}

View File

@ -31,9 +31,7 @@
class QByteArray;
class QString;
namespace Utils
{
namespace Password
namespace Utils::Password
{
// Implements constant-time comparison to protect against timing attacks
// Taken from https://crackstation.net/hashing-security.htm
@ -48,4 +46,3 @@ namespace Utils
bool verify(const QByteArray &secret, const QByteArray &password);
}
}
}

View File

@ -31,10 +31,7 @@
#include <cstdint>
#include <limits>
namespace Utils
{
namespace Random
namespace Utils::Random
{
uint32_t rand(uint32_t min = 0, uint32_t max = std::numeric_limits<uint32_t>::max());
}
}

View File

@ -37,9 +37,7 @@
class QStringRef;
namespace Utils
{
namespace String
namespace Utils::String
{
QString fromDouble(double n, int precision);
@ -92,4 +90,3 @@ namespace Utils
return (ok ? value : defaultValue);
}
}
}