diff --git a/application/argumentparser.h b/application/argumentparser.h index 628e5c0..bfe3ede 100644 --- a/application/argumentparser.h +++ b/application/argumentparser.h @@ -852,6 +852,6 @@ inline ConfigValueArgument::ConfigValueArgument( setRequiredValueCount(valueNames.size()); setValueNames(valueNames); } -} +} // namespace ApplicationUtilities #endif // APPLICATION_UTILITIES_ARGUMENTPARSER_H diff --git a/application/argumentparserprivate.h b/application/argumentparserprivate.h index 9c4414e..2ff2e32 100644 --- a/application/argumentparserprivate.h +++ b/application/argumentparserprivate.h @@ -31,6 +31,6 @@ public: /// \brief Whether completion mode is enabled. In this case reading args will be continued even if an denotation is unknown (regardless of unknownArgumentBehavior()). bool completionMode; }; -} +} // namespace ApplicationUtilities #endif // APPLICATION_UTILITIES_ARGUMENTPARSER_PRIVATE_H diff --git a/application/failure.cpp b/application/failure.cpp index 41c359d..cee1799 100644 --- a/application/failure.cpp +++ b/application/failure.cpp @@ -41,4 +41,4 @@ const char *Failure::what() const USE_NOTHROW { return m_what.c_str(); } -} +} // namespace ApplicationUtilities diff --git a/application/failure.h b/application/failure.h index f68607e..3098698 100644 --- a/application/failure.h +++ b/application/failure.h @@ -19,6 +19,6 @@ public: private: std::string m_what; }; -} +} // namespace ApplicationUtilities #endif // APPLICATION_UTILITIES_FAILURE_H diff --git a/chrono/datetime.h b/chrono/datetime.h index 66125df..7639182 100644 --- a/chrono/datetime.h +++ b/chrono/datetime.h @@ -490,7 +490,7 @@ inline DateTime &DateTime::operator-=(const TimeSpan &timeSpan) m_ticks -= timeSpan.m_ticks; return *this; } -} +} // namespace ChronoUtilities namespace std { template <> struct hash { @@ -499,6 +499,6 @@ template <> struct hash { return hash()(dateTime.totalTicks()); } }; -} +} // namespace std #endif // CHRONO_UTILITIES_DATETIME_H diff --git a/chrono/period.cpp b/chrono/period.cpp index 98ec0cc..19e5036 100644 --- a/chrono/period.cpp +++ b/chrono/period.cpp @@ -27,4 +27,4 @@ Period::Period(const DateTime &beg, const DateTime &end) --m_years; } } -} +} // namespace ChronoUtilities diff --git a/chrono/period.h b/chrono/period.h index 59d5f53..df2a290 100644 --- a/chrono/period.h +++ b/chrono/period.h @@ -41,6 +41,6 @@ inline int Period::days() const { return m_days; } -} +} // namespace ChronoUtilities #endif // CHRONO_UTILITIES_PERIOD_H diff --git a/chrono/timespan.h b/chrono/timespan.h index c666ff0..791d3fa 100644 --- a/chrono/timespan.h +++ b/chrono/timespan.h @@ -402,7 +402,7 @@ constexpr inline bool TimeSpan::isInfinity() const { return m_ticks == std::numeric_limits::max(); } -} +} // namespace ChronoUtilities namespace std { template <> struct hash { @@ -411,6 +411,6 @@ template <> struct hash { return hash()(timeSpan.totalTicks()); } }; -} +} // namespace std #endif // CHRONO_UTILITIES_TIMESPAN_H diff --git a/conversion/binaryconversion.h b/conversion/binaryconversion.h index 698a517..9f5e0fb 100644 --- a/conversion/binaryconversion.h +++ b/conversion/binaryconversion.h @@ -172,6 +172,6 @@ CPP_UTILITIES_EXPORT constexpr uint64 swapOrder(uint64 value) | ((value & 0x000000FF00000000) >> (1 * 8)) | ((value & 0x00000000FF000000) << (1 * 8)) | ((value & 0x0000000000FF0000) << (3 * 8)) | ((value & 0x000000000000FF00) << (5 * 8)) | ((value) << (7 * 8)); } -} +} // namespace ConversionUtilities #endif // CONVERSION_UTILITIES_BINARY_CONVERSION_H diff --git a/conversion/conversionexception.cpp b/conversion/conversionexception.cpp index 591758d..0b39748 100644 --- a/conversion/conversionexception.cpp +++ b/conversion/conversionexception.cpp @@ -29,4 +29,4 @@ ConversionException::ConversionException(const std::string &what) USE_NOTHROW : ConversionException::~ConversionException() USE_NOTHROW { } -} +} // namespace ConversionUtilities diff --git a/conversion/conversionexception.h b/conversion/conversionexception.h index 5c7f0d2..6b3770f 100644 --- a/conversion/conversionexception.h +++ b/conversion/conversionexception.h @@ -14,6 +14,6 @@ public: ConversionException(const std::string &what) USE_NOTHROW; ~ConversionException() USE_NOTHROW; }; -} +} // namespace ConversionUtilities #endif // CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H diff --git a/conversion/stringbuilder.h b/conversion/stringbuilder.h index 0bd3296..1d32186 100644 --- a/conversion/stringbuilder.h +++ b/conversion/stringbuilder.h @@ -34,8 +34,9 @@ constexpr std::size_t computeTupleElementSize(CharType) return 1; } -template >, - std::is_integral, std::is_unsigned>...> +template >, std::is_integral, + std::is_unsigned>...> std::size_t computeTupleElementSize(IntegralType number, typename StringType::value_type base = 10) { std::size_t size = 0; @@ -44,8 +45,9 @@ std::size_t computeTupleElementSize(IntegralType number, typename StringType::va return size; } -template >, - std::is_integral, std::is_signed>...> +template >, std::is_integral, + std::is_signed>...> std::size_t computeTupleElementSize(IntegralType number, typename StringType::value_type base = 10) { std::size_t size = number < 0 ? 1 : 0; @@ -76,8 +78,9 @@ void append(StringType &target, CharType c) target += c; } -template >, - std::is_integral, std::is_unsigned>...> +template >, std::is_integral, + std::is_unsigned>...> void append(StringType &target, IntegralType number, typename StringType::value_type base = 10) { const auto start = target.begin() + target.size(); @@ -87,8 +90,9 @@ void append(StringType &target, IntegralType number, typename StringType::value_ } while (number); } -template >, - std::is_integral, std::is_signed>...> +template >, std::is_integral, + std::is_signed>...> void append(StringType &target, IntegralType number, typename StringType::value_type base = 10) { if (number < 0) { @@ -126,7 +130,7 @@ template struct TupleToString(tuple)); } }; -} +} // namespace Helper /// \endcond /*! @@ -254,6 +258,6 @@ inline std::string operator+(const Tuple &lhs, IntegralType rhs) { return tupleToString(std::tuple_cat(lhs, std::make_tuple(rhs))); } -} +} // namespace ConversionUtilities #endif // CONVERSION_UTILITIES_STRINGBUILDER_H diff --git a/conversion/stringconversion.cpp b/conversion/stringconversion.cpp index 618994b..cd9f53d 100644 --- a/conversion/stringconversion.cpp +++ b/conversion/stringconversion.cpp @@ -363,4 +363,4 @@ pair, uint32> decodeBase64(const char *encodedStr, const uint } return make_pair(move(buffer), decodedSize); } -} +} // namespace ConversionUtilities diff --git a/conversion/stringconversion.h b/conversion/stringconversion.h index b59e252..d797c72 100644 --- a/conversion/stringconversion.h +++ b/conversion/stringconversion.h @@ -531,6 +531,6 @@ CPP_UTILITIES_EXPORT std::string dataSizeToString(uint64 sizeInByte, bool includ CPP_UTILITIES_EXPORT std::string bitrateToString(double speedInKbitsPerSecond, bool useByteInsteadOfBits = false); CPP_UTILITIES_EXPORT std::string encodeBase64(const byte *data, uint32 dataSize); CPP_UTILITIES_EXPORT std::pair, uint32> decodeBase64(const char *encodedStr, const uint32 strSize); -} +} // namespace ConversionUtilities #endif // CONVERSION_UTILITIES_STRINGCONVERSION_H diff --git a/conversion/widen.h b/conversion/widen.h index 287f345..89c6c06 100644 --- a/conversion/widen.h +++ b/conversion/widen.h @@ -46,6 +46,6 @@ private: std::locale m_loc; const std::ctype *m_pctype; }; -} +} // namespace ConversionUtilities #endif // CONVERSION_UTILITIES_WIDEN_H diff --git a/io/ansiescapecodes.h b/io/ansiescapecodes.h index d19bddc..d1d5310 100644 --- a/io/ansiescapecodes.h +++ b/io/ansiescapecodes.h @@ -79,6 +79,6 @@ inline void eraseLine(std::ostream &stream) { stream << "\33[2K"; } -} +} // namespace EscapeCodes #endif // IOUTILITIES_ANSIESCAPECODES diff --git a/io/binaryreader.h b/io/binaryreader.h index 00279d8..b97d433 100644 --- a/io/binaryreader.h +++ b/io/binaryreader.h @@ -557,6 +557,6 @@ inline float32 BinaryReader::readFixed16LE() { return ConversionUtilities::toFloat32(readUInt32LE()); } -} +} // namespace IoUtilities #endif // IOUTILITIES_BINERYREADER_H diff --git a/io/binarywriter.h b/io/binarywriter.h index ee9838a..cd6d631 100644 --- a/io/binarywriter.h +++ b/io/binarywriter.h @@ -525,6 +525,6 @@ inline void BinaryWriter::writeFixed16LE(float32 valueToConvertAndWrite) { writeUInt32LE(ConversionUtilities::toFixed16(valueToConvertAndWrite)); } -} +} // namespace IoUtilities #endif // IO_UTILITIES_BINARYWRITER_H diff --git a/io/catchiofailure.cpp b/io/catchiofailure.cpp index 6c84986..c58a8e4 100644 --- a/io/catchiofailure.cpp +++ b/io/catchiofailure.cpp @@ -38,4 +38,4 @@ void throwIoFailure(const char *what) { throw ios_base::failure(what); } -} +} // namespace IoUtilities diff --git a/io/catchiofailure.h b/io/catchiofailure.h index 5ec97a5..8e89b5f 100644 --- a/io/catchiofailure.h +++ b/io/catchiofailure.h @@ -9,6 +9,6 @@ namespace IoUtilities { CPP_UTILITIES_EXPORT const char *catchIoFailure(); CPP_UTILITIES_EXPORT void throwIoFailure(const char *what); -} +} // namespace IoUtilities #endif // IOUTILITIES_CATCHIOFAILURE_H diff --git a/io/copy.h b/io/copy.h index 338662e..e781a2e 100644 --- a/io/copy.h +++ b/io/copy.h @@ -84,6 +84,6 @@ template char *CopyHelper::buffer() { return m_buffer; } -} +} // namespace IoUtilities #endif // IOUTILITIES_COPY_H diff --git a/io/misc.cpp b/io/misc.cpp index ad92f55..be79c3f 100644 --- a/io/misc.cpp +++ b/io/misc.cpp @@ -29,4 +29,4 @@ string readFile(const string &path, std::string::size_type maxSize) res.assign((istreambuf_iterator(file)), istreambuf_iterator()); return res; } -} +} // namespace IoUtilities diff --git a/io/path.cpp b/io/path.cpp index d57806f..a0cdae2 100644 --- a/io/path.cpp +++ b/io/path.cpp @@ -112,8 +112,8 @@ bool settingsDirectory(std::string &result, std::string applicationDirectoryName #if defined(PLATFORM_UNIX) struct stat sb; return (stat(result.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)); -#else // PLATFORM_WINDOWS - // FIXME: use UTF-16 API to support unicode, or rewrite using fs abstraction lib +#else // PLATFORM_WINDOWS \ + // FIXME: use UTF-16 API to support unicode, or rewrite using fs abstraction lib DWORD ftyp = GetFileAttributesA(result.c_str()); return (ftyp != INVALID_FILE_ATTRIBUTES) && (ftyp & FILE_ATTRIBUTE_DIRECTORY); #endif @@ -209,4 +209,4 @@ std::list directoryEntries(const char *path, DirectoryEntryType typ return list(); // TODO #endif } -} +} // namespace IoUtilities diff --git a/io/path.h b/io/path.h index 7e0edc6..e5abdab 100644 --- a/io/path.h +++ b/io/path.h @@ -46,6 +46,6 @@ CPP_UTILITIES_EXPORT void removeInvalidChars(std::string &fileName); CPP_UTILITIES_EXPORT bool settingsDirectory( std::string &result, std::string applicationDirectoryName = std::string(), bool createApplicationDirectory = false); CPP_UTILITIES_EXPORT std::list directoryEntries(const char *path, DirectoryEntryType types = DirectoryEntryType::All); -} +} // namespace IoUtilities #endif // IOUTILITIES_PATHHELPER_H diff --git a/math/math.cpp b/math/math.cpp index 7126080..3f1be22 100644 --- a/math/math.cpp +++ b/math/math.cpp @@ -90,4 +90,4 @@ uint64 orderModulo(const uint64 number, const uint64 module) ; return order != module ? order : 0; } -} +} // namespace MathUtilities diff --git a/math/math.h b/math/math.h index 95e5402..3f259de 100644 --- a/math/math.h +++ b/math/math.h @@ -12,6 +12,6 @@ CPP_UTILITIES_EXPORT int factorial(int number); CPP_UTILITIES_EXPORT uint64 powerModulo(uint64 base, uint64 expontent, uint64 module); CPP_UTILITIES_EXPORT int64 inverseModulo(int64 number, int64 module); CPP_UTILITIES_EXPORT uint64 orderModulo(uint64 number, uint64 module); -} +} // namespace MathUtilities #endif // MATHUTILITIES_H diff --git a/misc/memory.h b/misc/memory.h index a2b8bbc..568dcb7 100644 --- a/misc/memory.h +++ b/misc/memory.h @@ -35,7 +35,7 @@ template inline typename _MakeUniq<_Tp>::__array make_unique(size /// Disable std::make_unique for arrays of known bound template inline typename _MakeUniq<_Tp>::__invalid_type make_unique(_Args &&...) = delete; -} +} // namespace std #endif /// \endcond diff --git a/misc/random.cpp b/misc/random.cpp index 31c8dea..a2fd5de 100644 --- a/misc/random.cpp +++ b/misc/random.cpp @@ -124,4 +124,4 @@ void generateRandomCharacterSequence(char *result, unsigned int length, bool use generateRandomCharacterSequence( result, length, rand, RAND_MAX, useSmallLetters, useCapitalLetters, useNumbers, useSymbols, useAtLeastOneOfEachCategory); } -} +} // namespace RandomUtilities diff --git a/misc/random.h b/misc/random.h index 83ba3a9..5ef3747 100644 --- a/misc/random.h +++ b/misc/random.h @@ -12,6 +12,6 @@ CPP_UTILITIES_EXPORT void generateRandomCharacterSequence(char *result, unsigned CPP_UTILITIES_EXPORT void generateRandomCharacterSequence(char *result, unsigned int length, std::function randomizer, int maximalRandomNumber, bool useSmallLetters = true, bool useCapitalLetters = true, bool useNumbers = true, bool useSymbols = true, bool useAtLeastOneOfEachCategory = true); -} +} // namespace RandomUtilities #endif // RANDOMUTILS_H diff --git a/misc/traits.h b/misc/traits.h index 909be12..2e9e63c 100644 --- a/misc/traits.h +++ b/misc/traits.h @@ -65,10 +65,10 @@ auto isIteratableImpl(int) -> decltype( void(*begin(std::declval())), Bool{}); template Bool isIteratableImpl(...); -} +} // namespace Detail /// \endcond template using IsIteratable = decltype(Detail::isIteratableImpl(0)); -} +} // namespace Traits #endif // CPP_UTILITIES_TRAITS_H diff --git a/tests/iotests.cpp b/tests/iotests.cpp index 3a24ad2..249de81 100644 --- a/tests/iotests.cpp +++ b/tests/iotests.cpp @@ -134,10 +134,11 @@ void IoTests::testBinaryReader() CPPUNIT_ASSERT(reader.readBool() == true); CPPUNIT_ASSERT(reader.readString(3) == "abc"); CPPUNIT_ASSERT(reader.readLengthPrefixedString() == "ABC"); - CPPUNIT_ASSERT(reader.readLengthPrefixedString() == "01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901" - "23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123" - "45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345" - "678901234567890123456789"); + CPPUNIT_ASSERT(reader.readLengthPrefixedString() + == "01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901" + "23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123" + "45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345" + "678901234567890123456789"); CPPUNIT_ASSERT(reader.readTerminatedString() == "def"); CPPUNIT_ASSERT_THROW(reader.readLengthPrefixedString(), ConversionException); CPPUNIT_ASSERT_MESSAGE("pos in stream not advanced on conversion error", reader.readByte() == 0); diff --git a/tests/testutils.cpp b/tests/testutils.cpp index 67ef671..1ab2d37 100644 --- a/tests/testutils.cpp +++ b/tests/testutils.cpp @@ -392,4 +392,4 @@ int execHelperApp(const char *appPath, const char *const *args, std::string &out return execAppInternal(appPath, args, output, errors, suppressLogging, timeout, string()); } #endif -} +} // namespace TestUtilities diff --git a/tests/testutils.h b/tests/testutils.h index e739dd4..320e597 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -217,7 +217,7 @@ constexpr int64 operator"" _int64(unsigned long long size) { return static_cast(size); } -} -} +} // namespace Literals +} // namespace TestUtilities #endif // TESTUTILS_H