Browse Source

Use nested namespaces definition syntax

adaptive-webui-19844
Vladimir Golovnev (Glassez) 4 years ago
parent
commit
552ff0489d
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
  1. 5
      src/base/utils/bytearray.h
  2. 5
      src/base/utils/foreignapps.h
  3. 5
      src/base/utils/fs.h
  4. 5
      src/base/utils/gzip.h
  5. 5
      src/base/utils/io.h
  6. 5
      src/base/utils/misc.h
  7. 5
      src/base/utils/net.h
  8. 5
      src/base/utils/password.h
  9. 5
      src/base/utils/random.h
  10. 5
      src/base/utils/string.h

5
src/base/utils/bytearray.h

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

5
src/base/utils/foreignapps.h

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

5
src/base/utils/fs.h

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

5
src/base/utils/gzip.h

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

5
src/base/utils/io.h

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

5
src/base/utils/misc.h

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

5
src/base/utils/net.h

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

5
src/base/utils/password.h

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

5
src/base/utils/random.h

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

5
src/base/utils/string.h

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

Loading…
Cancel
Save