diff --git a/beast/cxx14/algorithm.h b/beast/cxx14/algorithm.h index c72a631bc2..f10bd7bb99 100644 --- a/beast/cxx14/algorithm.h +++ b/beast/cxx14/algorithm.h @@ -25,6 +25,8 @@ #include +#if ! BEAST_NO_CXX14_EQUAL + namespace std { namespace detail { @@ -88,3 +90,5 @@ bool equal (FwdIt1 first1, FwdIt1 last1, } #endif + +#endif diff --git a/beast/cxx14/config.h b/beast/cxx14/config.h index 841e9052c0..cf0541c3bd 100644 --- a/beast/cxx14/config.h +++ b/beast/cxx14/config.h @@ -23,22 +23,32 @@ // Sets C++14 compatibility configuration macros based on build environment // Disables beast c++14 compatibility additions when set to 1 +// Note, some compatibilty features are enabled or disabled individually. // #ifndef BEAST_NO_CXX14_COMPATIBILITY # ifdef _MSC_VER # define BEAST_NO_CXX14_COMPATIBILITY 1 +# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201305 +# define BEAST_NO_CXX14_COMPATIBILITY 1 # else # define BEAST_NO_CXX14_COMPATIBILITY 0 # endif #endif -// Disables beast's make_unique +// Disables beast's std::make_unique #ifndef BEAST_NO_CXX14_MAKE_UNIQUE # ifdef _MSC_VER # define BEAST_NO_CXX14_MAKE_UNIQUE 1 +# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201305 +# define BEAST_NO_CXX14_MAKE_UNIQUE 1 # else # define BEAST_NO_CXX14_MAKE_UNIQUE 0 # endif #endif +// Disables beast's std::equal safe iterator overloads +#ifndef BEAST_NO_CXX14_EQUAL +# define BEAST_NO_CXX14_EQUAL 0 +#endif + #endif diff --git a/modules/beast_asio/async/AsyncObject.h b/modules/beast_asio/async/AsyncObject.h index ef4ef17583..cc36049b73 100644 --- a/modules/beast_asio/async/AsyncObject.h +++ b/modules/beast_asio/async/AsyncObject.h @@ -80,7 +80,7 @@ public: private: // The number of handlers pending. - Atomic m_pending; + beast::Atomic m_pending; }; } diff --git a/modules/beast_core/beast_core.cpp b/modules/beast_core/beast_core.cpp index 37a36b7381..d250fbd476 100644 --- a/modules/beast_core/beast_core.cpp +++ b/modules/beast_core/beast_core.cpp @@ -126,9 +126,6 @@ #undef _aligned_msize #endif -namespace beast -{ - #include "containers/DynamicObject.cpp" #include "containers/NamedValueSet.cpp" #include "containers/PropertySet.cpp" @@ -256,8 +253,6 @@ namespace beast #include "threads/HighResolutionTimer.cpp" -} - // Has to be outside the beast namespace extern "C" { void beast_reportFatalError (char const* message, char const* fileName, int lineNumber) diff --git a/modules/beast_core/beast_core.h b/modules/beast_core/beast_core.h index a5d6ab17c7..d02ec74577 100644 --- a/modules/beast_core/beast_core.h +++ b/modules/beast_core/beast_core.h @@ -63,13 +63,16 @@ #include "system/StandardIncludes.h" -namespace beast { +namespace beast +{ class InputStream; class OutputStream; class FileInputStream; class FileOutputStream; +} // namespace beast + // Order matters, since headers don't have their own #include lines. // Add new includes to the bottom. @@ -209,8 +212,6 @@ class FileOutputStream; #include "thread/Workers.h" -} - #if BEAST_MSVC #pragma warning (pop) #endif diff --git a/modules/beast_core/containers/Array.h b/modules/beast_core/containers/Array.h index 97eac103f2..d516cbfd2d 100644 --- a/modules/beast_core/containers/Array.h +++ b/modules/beast_core/containers/Array.h @@ -24,6 +24,9 @@ #ifndef BEAST_ARRAY_H_INCLUDED #define BEAST_ARRAY_H_INCLUDED +namespace beast +{ + //============================================================================== /** Holds a resizable array of primitive or copy-by-value objects. @@ -1052,4 +1055,6 @@ private: } }; +} // namespace beast + #endif // BEAST_ARRAY_H_INCLUDED diff --git a/modules/beast_core/containers/ArrayAllocationBase.h b/modules/beast_core/containers/ArrayAllocationBase.h index 6887392cd6..43f0920115 100644 --- a/modules/beast_core/containers/ArrayAllocationBase.h +++ b/modules/beast_core/containers/ArrayAllocationBase.h @@ -24,6 +24,9 @@ #ifndef BEAST_ARRAYALLOCATIONBASE_H_INCLUDED #define BEAST_ARRAYALLOCATIONBASE_H_INCLUDED +namespace beast +{ + //============================================================================== /** Implements some basic array storage allocation functions. @@ -126,4 +129,6 @@ public: int numAllocated; }; +} // namespace beast + #endif // BEAST_ARRAYALLOCATIONBASE_H_INCLUDED diff --git a/modules/beast_core/containers/DynamicObject.cpp b/modules/beast_core/containers/DynamicObject.cpp index 0a5e15462d..edf8a58880 100644 --- a/modules/beast_core/containers/DynamicObject.cpp +++ b/modules/beast_core/containers/DynamicObject.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + DynamicObject::DynamicObject() { } @@ -72,3 +75,5 @@ void DynamicObject::clear() { properties.clear(); } + +} // namespace beast diff --git a/modules/beast_core/containers/DynamicObject.h b/modules/beast_core/containers/DynamicObject.h index 56e4cf7b65..c3a8556dd3 100644 --- a/modules/beast_core/containers/DynamicObject.h +++ b/modules/beast_core/containers/DynamicObject.h @@ -24,6 +24,9 @@ #ifndef BEAST_DYNAMICOBJECT_H_INCLUDED #define BEAST_DYNAMICOBJECT_H_INCLUDED +namespace beast +{ + //============================================================================== /** Represents a dynamically implemented object. @@ -112,6 +115,6 @@ private: NamedValueSet properties; }; - +} // namespace beast #endif // BEAST_DYNAMICOBJECT_H_INCLUDED diff --git a/modules/beast_core/containers/ElementComparator.h b/modules/beast_core/containers/ElementComparator.h index 438628ed9e..929e71ca71 100644 --- a/modules/beast_core/containers/ElementComparator.h +++ b/modules/beast_core/containers/ElementComparator.h @@ -24,6 +24,9 @@ #ifndef BEAST_ELEMENTCOMPARATOR_H_INCLUDED #define BEAST_ELEMENTCOMPARATOR_H_INCLUDED +namespace beast +{ + #ifndef DOXYGEN /** This is an internal helper class which converts a beast ElementComparator style @@ -185,5 +188,7 @@ public: } }; +} // namespace beast + #endif diff --git a/modules/beast_core/containers/LinkedListPointer.h b/modules/beast_core/containers/LinkedListPointer.h index b55f2e9939..4ab1aca684 100644 --- a/modules/beast_core/containers/LinkedListPointer.h +++ b/modules/beast_core/containers/LinkedListPointer.h @@ -24,6 +24,8 @@ #ifndef BEAST_LINKEDLISTPOINTER_H_INCLUDED #define BEAST_LINKEDLISTPOINTER_H_INCLUDED +namespace beast +{ //============================================================================== /** @@ -358,5 +360,6 @@ private: ObjectType* item; }; +} // namespace beast #endif // BEAST_LINKEDLISTPOINTER_H_INCLUDED diff --git a/modules/beast_core/containers/NamedValueSet.cpp b/modules/beast_core/containers/NamedValueSet.cpp index e092865eb4..7bdc0816f9 100644 --- a/modules/beast_core/containers/NamedValueSet.cpp +++ b/modules/beast_core/containers/NamedValueSet.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + NamedValueSet::NamedValue::NamedValue() noexcept { } @@ -302,3 +305,5 @@ void NamedValueSet::copyToXmlAttributes (XmlElement& xml) const } } } + +} // namespace beast diff --git a/modules/beast_core/containers/NamedValueSet.h b/modules/beast_core/containers/NamedValueSet.h index 24e4bcc65e..58c7183c2f 100644 --- a/modules/beast_core/containers/NamedValueSet.h +++ b/modules/beast_core/containers/NamedValueSet.h @@ -24,6 +24,9 @@ #ifndef BEAST_NAMEDVALUESET_H_INCLUDED #define BEAST_NAMEDVALUESET_H_INCLUDED +namespace beast +{ + class XmlElement; #ifndef DOXYGEN class JSONFormatter; @@ -157,5 +160,6 @@ private: friend class JSONFormatter; }; +} // namespace beast #endif // BEAST_NAMEDVALUESET_H_INCLUDED diff --git a/modules/beast_core/containers/OwnedArray.h b/modules/beast_core/containers/OwnedArray.h index 52b31cbb88..b971690dae 100644 --- a/modules/beast_core/containers/OwnedArray.h +++ b/modules/beast_core/containers/OwnedArray.h @@ -24,6 +24,9 @@ #ifndef BEAST_OWNEDARRAY_H_INCLUDED #define BEAST_OWNEDARRAY_H_INCLUDED +namespace beast +{ + //============================================================================== /** An array designed for holding objects. @@ -885,5 +888,6 @@ private: } }; +} // namespace beast #endif diff --git a/modules/beast_core/containers/PropertySet.cpp b/modules/beast_core/containers/PropertySet.cpp index c87e5cfb1f..2ee1a12160 100644 --- a/modules/beast_core/containers/PropertySet.cpp +++ b/modules/beast_core/containers/PropertySet.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + PropertySet::PropertySet (const bool ignoreCaseOfKeyNames) : properties (ignoreCaseOfKeyNames), fallbackProperties (nullptr), @@ -216,3 +219,5 @@ void PropertySet::restoreFromXml (const XmlElement& xml) void PropertySet::propertyChanged() { } + +} // namespace beast diff --git a/modules/beast_core/containers/PropertySet.h b/modules/beast_core/containers/PropertySet.h index 40d84f992d..1e003fec95 100644 --- a/modules/beast_core/containers/PropertySet.h +++ b/modules/beast_core/containers/PropertySet.h @@ -24,6 +24,9 @@ #ifndef BEAST_PROPERTYSET_H_INCLUDED #define BEAST_PROPERTYSET_H_INCLUDED +namespace beast +{ + //============================================================================== /** A set of named property values, which can be strings, integers, floating point, etc. @@ -203,5 +206,6 @@ private: bool ignoreCaseOfKeys; }; +} // namespace beast #endif // BEAST_PROPERTYSET_H_INCLUDED diff --git a/modules/beast_core/containers/ScopedValueSetter.h b/modules/beast_core/containers/ScopedValueSetter.h index ff10da1315..3859b74921 100644 --- a/modules/beast_core/containers/ScopedValueSetter.h +++ b/modules/beast_core/containers/ScopedValueSetter.h @@ -24,6 +24,8 @@ #ifndef BEAST_SCOPEDVALUESETTER_H_INCLUDED #define BEAST_SCOPEDVALUESETTER_H_INCLUDED +namespace beast +{ //============================================================================== /** @@ -89,5 +91,6 @@ private: const ValueType originalValue; }; +} // namespace beast #endif // BEAST_SCOPEDVALUESETTER_H_INCLUDED diff --git a/modules/beast_core/containers/SparseSet.h b/modules/beast_core/containers/SparseSet.h index 807a75038e..ebe49b33a5 100644 --- a/modules/beast_core/containers/SparseSet.h +++ b/modules/beast_core/containers/SparseSet.h @@ -24,6 +24,9 @@ #ifndef BEAST_SPARSESET_H_INCLUDED #define BEAST_SPARSESET_H_INCLUDED +namespace beast +{ + //============================================================================== /** Holds a set of primitive values, storing them as a set of ranges. @@ -287,6 +290,6 @@ private: } }; - +} // namespace beast #endif // BEAST_SPARSESET_H_INCLUDED diff --git a/modules/beast_core/containers/Variant.cpp b/modules/beast_core/containers/Variant.cpp index 943064a7c4..bb923ce4f5 100644 --- a/modules/beast_core/containers/Variant.cpp +++ b/modules/beast_core/containers/Variant.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + enum VariantStreamMarkers { varMarker_Int = 1, @@ -702,3 +705,5 @@ var var::readFromStream (InputStream& input) return var::null; } + +} // namespace beast diff --git a/modules/beast_core/containers/Variant.h b/modules/beast_core/containers/Variant.h index 927979080e..3ddc1c5dca 100644 --- a/modules/beast_core/containers/Variant.h +++ b/modules/beast_core/containers/Variant.h @@ -24,6 +24,9 @@ #ifndef BEAST_VARIANT_H_INCLUDED #define BEAST_VARIANT_H_INCLUDED +namespace beast +{ + #ifndef DOXYGEN class SharedObject; class DynamicObject; @@ -293,5 +296,6 @@ bool operator!= (const var& v1, const String& v2); bool operator== (const var& v1, const char* v2); bool operator!= (const var& v1, const char* v2); +} // namespace beast #endif // BEAST_VARIANT_H_INCLUDED diff --git a/modules/beast_core/diagnostic/FPUFlags.cpp b/modules/beast_core/diagnostic/FPUFlags.cpp index 39eb589cfc..5ba2acb25e 100644 --- a/modules/beast_core/diagnostic/FPUFlags.cpp +++ b/modules/beast_core/diagnostic/FPUFlags.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + void FPUFlags::clearUnsetFlagsFrom (FPUFlags const& flags) { if (!flags.getMaskNaNs ().is_set ()) m_maskNaNs.clear (); @@ -38,3 +41,5 @@ void FPUFlags::clearUnsetFlagsFrom (FPUFlags const& flags) if (!flags.getPrecision ().is_set ()) m_precision.clear (); } + +} // namespace beast diff --git a/modules/beast_core/diagnostic/FPUFlags.h b/modules/beast_core/diagnostic/FPUFlags.h index 73c17e56f0..9b4f2c4362 100644 --- a/modules/beast_core/diagnostic/FPUFlags.h +++ b/modules/beast_core/diagnostic/FPUFlags.h @@ -20,6 +20,9 @@ #ifndef BEAST_FPUFLAGS_H_INCLUDED #define BEAST_FPUFLAGS_H_INCLUDED +namespace beast +{ + /*============================================================================*/ /** A set of IEEE FPU flags. @@ -331,5 +334,7 @@ private: FPUFlags m_savedFlags; }; +} // namespace beast + #endif diff --git a/modules/beast_core/diagnostic/FatalError.cpp b/modules/beast_core/diagnostic/FatalError.cpp index dc23017385..295c44ceb3 100644 --- a/modules/beast_core/diagnostic/FatalError.cpp +++ b/modules/beast_core/diagnostic/FatalError.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + // // FatalError::Reporter // @@ -130,3 +133,5 @@ public: }; static FatalErrorTests fatalErrorTests; + +} // namespace beast diff --git a/modules/beast_core/diagnostic/FatalError.h b/modules/beast_core/diagnostic/FatalError.h index 861575b314..5aa949d5b8 100644 --- a/modules/beast_core/diagnostic/FatalError.h +++ b/modules/beast_core/diagnostic/FatalError.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_FATALERROR_H_INCLUDED #define BEAST_CORE_FATALERROR_H_INCLUDED +namespace beast +{ + /** Signal a fatal error. A fatal error indicates that the program has encountered an unexpected @@ -146,4 +149,6 @@ private: static Reporter* s_reporter; }; +} // namespace beast + #endif diff --git a/modules/beast_core/diagnostic/MeasureFunctionCallTime.h b/modules/beast_core/diagnostic/MeasureFunctionCallTime.h index 99efe3412b..41a05dbed9 100644 --- a/modules/beast_core/diagnostic/MeasureFunctionCallTime.h +++ b/modules/beast_core/diagnostic/MeasureFunctionCallTime.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED #define BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED +namespace beast +{ + /** Measures the speed of invoking a function. */ /** @{ */ template @@ -77,4 +80,6 @@ double measureFunctionCallTime (Function f, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P } #endif +} // namespace beast + #endif diff --git a/modules/beast_core/diagnostic/SemanticVersion.cpp b/modules/beast_core/diagnostic/SemanticVersion.cpp index a8b4427424..56ffd366d7 100644 --- a/modules/beast_core/diagnostic/SemanticVersion.cpp +++ b/modules/beast_core/diagnostic/SemanticVersion.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + SemanticVersion::SemanticVersion () : majorVersion (0) , minorVersion (0) @@ -517,3 +520,5 @@ public: }; static SemanticVersionTests semanticVersionTests; + +} // namespace beast diff --git a/modules/beast_core/diagnostic/SemanticVersion.h b/modules/beast_core/diagnostic/SemanticVersion.h index e24d46f666..691f9ff5d0 100644 --- a/modules/beast_core/diagnostic/SemanticVersion.h +++ b/modules/beast_core/diagnostic/SemanticVersion.h @@ -20,6 +20,9 @@ #ifndef BEAST_SEMANTICVERSION_H_INCLUDED #define BEAST_SEMANTICVERSION_H_INCLUDED +namespace beast +{ + /** A Semantic Version number. Identifies the build of a particular version of software using @@ -71,4 +74,6 @@ private: static bool chopIdentifiers (StringArray* value, bool preRelease, String& input); }; +} // namespace beast + #endif diff --git a/modules/beast_core/diagnostic/Throw.h b/modules/beast_core/diagnostic/Throw.h index e5c86f1b4a..bef8b256a6 100644 --- a/modules/beast_core/diagnostic/Throw.h +++ b/modules/beast_core/diagnostic/Throw.h @@ -20,6 +20,9 @@ #ifndef BEAST_THROW_H_INCLUDED #define BEAST_THROW_H_INCLUDED +namespace beast +{ + /** Throw an exception, with a debugger hook. This provides an opportunity to utilize the debugger before @@ -36,4 +39,6 @@ void Throw (Exception const& e, char const* = "", int = 0) throw e; } +} // namespace beast + #endif diff --git a/modules/beast_core/diagnostic/UnitTest.cpp b/modules/beast_core/diagnostic/UnitTest.cpp index 5d94ab60bb..c14a5c16b8 100644 --- a/modules/beast_core/diagnostic/UnitTest.cpp +++ b/modules/beast_core/diagnostic/UnitTest.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + UnitTest::UnitTest (String const& className, String const& packageName, When when) @@ -477,3 +480,5 @@ public: }; static UnitTestsPrinter unitTestsPrinter; + +} // namespace beast diff --git a/modules/beast_core/diagnostic/UnitTest.h b/modules/beast_core/diagnostic/UnitTest.h index 71c3091bf2..d28bf7a695 100644 --- a/modules/beast_core/diagnostic/UnitTest.h +++ b/modules/beast_core/diagnostic/UnitTest.h @@ -24,6 +24,9 @@ #ifndef BEAST_UNITTEST_H_INCLUDED #define BEAST_UNITTEST_H_INCLUDED +namespace beast +{ + class UnitTests; /** This is a base class for classes that perform a unit test. @@ -547,4 +550,6 @@ private: JournalSink m_sink; }; +} // namespace beast + #endif diff --git a/modules/beast_core/diagnostic/UnitTestUtilities.cpp b/modules/beast_core/diagnostic/UnitTestUtilities.cpp index a18293a9be..7875d0da7a 100644 --- a/modules/beast_core/diagnostic/UnitTestUtilities.cpp +++ b/modules/beast_core/diagnostic/UnitTestUtilities.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + namespace UnitTestUtilities { @@ -197,3 +200,5 @@ public: }; static UnitTestUtilitiesTests unitTestUtilitiesTests; + +} // namespace beast diff --git a/modules/beast_core/diagnostic/UnitTestUtilities.h b/modules/beast_core/diagnostic/UnitTestUtilities.h index 2e2df5d962..c42b431666 100644 --- a/modules/beast_core/diagnostic/UnitTestUtilities.h +++ b/modules/beast_core/diagnostic/UnitTestUtilities.h @@ -20,6 +20,9 @@ #ifndef BEAST_UNITTESTUTILITIES_H_INCLUDED #define BEAST_UNITTESTUTILITIES_H_INCLUDED +namespace beast +{ + namespace UnitTestUtilities { @@ -132,4 +135,6 @@ private: } +} // namespace beast + #endif diff --git a/modules/beast_core/files/DirectoryIterator.cpp b/modules/beast_core/files/DirectoryIterator.cpp index ce51b47927..5195f20697 100644 --- a/modules/beast_core/files/DirectoryIterator.cpp +++ b/modules/beast_core/files/DirectoryIterator.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + static StringArray parseWildcards (const String& pattern) { StringArray s; @@ -152,3 +155,5 @@ float DirectoryIterator::getEstimatedProgress() const return detailedIndex / totalNumFiles; } + +} // namespace beast diff --git a/modules/beast_core/files/DirectoryIterator.h b/modules/beast_core/files/DirectoryIterator.h index 74d6153283..62c43351ba 100644 --- a/modules/beast_core/files/DirectoryIterator.h +++ b/modules/beast_core/files/DirectoryIterator.h @@ -24,6 +24,9 @@ #ifndef BEAST_DIRECTORYITERATOR_H_INCLUDED #define BEAST_DIRECTORYITERATOR_H_INCLUDED +namespace beast +{ + //============================================================================== /** Searches through a the files in a directory, returning each file that is found. @@ -143,4 +146,6 @@ private: File currentFile; }; +} // namespace beast + #endif // BEAST_DIRECTORYITERATOR_H_INCLUDED diff --git a/modules/beast_core/files/File.cpp b/modules/beast_core/files/File.cpp index 9717dca5da..ba26fae0e1 100644 --- a/modules/beast_core/files/File.cpp +++ b/modules/beast_core/files/File.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + // We need to make a shared singleton or else there are // issues with the leak detector and order of detruction. // @@ -1101,3 +1104,4 @@ public: static FileTests fileTests; +} // namespace beast diff --git a/modules/beast_core/files/File.h b/modules/beast_core/files/File.h index e5cfa4fe36..03ad73f654 100644 --- a/modules/beast_core/files/File.h +++ b/modules/beast_core/files/File.h @@ -24,6 +24,9 @@ #ifndef BEAST_FILE_H_INCLUDED #define BEAST_FILE_H_INCLUDED +namespace beast +{ + //============================================================================== /** Represents a local file or directory. @@ -948,5 +951,7 @@ private: bool setFileReadOnlyInternal (bool) const; }; +} // namespace beast + #endif diff --git a/modules/beast_core/files/FileInputStream.cpp b/modules/beast_core/files/FileInputStream.cpp index bceed5ba2f..6edec461b2 100644 --- a/modules/beast_core/files/FileInputStream.cpp +++ b/modules/beast_core/files/FileInputStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + int64 beast_fileSetPosition (void* handle, int64 pos); //============================================================================== @@ -88,3 +91,5 @@ bool FileInputStream::setPosition (int64 pos) return true; } + +} // namespace beast diff --git a/modules/beast_core/files/FileInputStream.h b/modules/beast_core/files/FileInputStream.h index cbf1b47bf5..cbe26120dc 100644 --- a/modules/beast_core/files/FileInputStream.h +++ b/modules/beast_core/files/FileInputStream.h @@ -24,6 +24,9 @@ #ifndef BEAST_FILEINPUTSTREAM_H_INCLUDED #define BEAST_FILEINPUTSTREAM_H_INCLUDED +namespace beast +{ + //============================================================================== /** An input stream that reads from a local file. @@ -87,4 +90,6 @@ private: size_t readInternal (void* buffer, size_t numBytes); }; +} // namespace beast + #endif // BEAST_FILEINPUTSTREAM_H_INCLUDED diff --git a/modules/beast_core/files/FileOutputStream.cpp b/modules/beast_core/files/FileOutputStream.cpp index b7f24708f3..f61829cb7a 100644 --- a/modules/beast_core/files/FileOutputStream.cpp +++ b/modules/beast_core/files/FileOutputStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + int64 beast_fileSetPosition (void* handle, int64 pos); //============================================================================== @@ -127,4 +130,6 @@ bool FileOutputStream::writeRepeatedByte (uint8 byte, size_t numBytes) } return OutputStream::writeRepeatedByte (byte, numBytes); -} \ No newline at end of file +} + +} // namespace beast diff --git a/modules/beast_core/files/FileOutputStream.h b/modules/beast_core/files/FileOutputStream.h index 74b30d825b..18adec0f4f 100644 --- a/modules/beast_core/files/FileOutputStream.h +++ b/modules/beast_core/files/FileOutputStream.h @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + #ifndef BEAST_FILEOUTPUTSTREAM_H_INCLUDED #define BEAST_FILEOUTPUTSTREAM_H_INCLUDED @@ -107,4 +110,6 @@ private: ssize_t writeInternal (const void*, size_t); }; +} // namespace beast + #endif \ No newline at end of file diff --git a/modules/beast_core/files/FileSearchPath.cpp b/modules/beast_core/files/FileSearchPath.cpp index bfef91dd77..156ccb32ee 100644 --- a/modules/beast_core/files/FileSearchPath.cpp +++ b/modules/beast_core/files/FileSearchPath.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + FileSearchPath::FileSearchPath() { } @@ -164,3 +167,5 @@ bool FileSearchPath::isFileInPath (const File& fileToCheck, return false; } + +} // namespace beast diff --git a/modules/beast_core/files/FileSearchPath.h b/modules/beast_core/files/FileSearchPath.h index 7c7d075e45..9bf2a3a231 100644 --- a/modules/beast_core/files/FileSearchPath.h +++ b/modules/beast_core/files/FileSearchPath.h @@ -24,6 +24,9 @@ #ifndef BEAST_FILESEARCHPATH_H_INCLUDED #define BEAST_FILESEARCHPATH_H_INCLUDED +namespace beast +{ + //============================================================================== /** Encapsulates a set of folders that make up a search path. @@ -155,4 +158,6 @@ private: void init (const String& path); }; +} // namespace beast + #endif // BEAST_FILESEARCHPATH_H_INCLUDED diff --git a/modules/beast_core/files/MemoryMappedFile.h b/modules/beast_core/files/MemoryMappedFile.h index f621966519..1856e3eee1 100644 --- a/modules/beast_core/files/MemoryMappedFile.h +++ b/modules/beast_core/files/MemoryMappedFile.h @@ -24,6 +24,8 @@ #ifndef BEAST_MEMORYMAPPEDFILE_H_INCLUDED #define BEAST_MEMORYMAPPEDFILE_H_INCLUDED +namespace beast +{ //============================================================================== /** @@ -104,5 +106,6 @@ private: void openInternal (const File&, AccessMode); }; +} // namespace beast #endif // BEAST_MEMORYMAPPEDFILE_H_INCLUDED diff --git a/modules/beast_core/files/RandomAccessFile.cpp b/modules/beast_core/files/RandomAccessFile.cpp index 84814b56c1..a20270ca1a 100644 --- a/modules/beast_core/files/RandomAccessFile.cpp +++ b/modules/beast_core/files/RandomAccessFile.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + RandomAccessFile::RandomAccessFile () noexcept : fileHandle (nullptr) , currentPosition (0) @@ -270,3 +273,5 @@ private: }; static RandomAccessFileTests randomAccessFileTests; + +} // namespace beast diff --git a/modules/beast_core/files/RandomAccessFile.h b/modules/beast_core/files/RandomAccessFile.h index 05f87a3116..d6c409a2f3 100644 --- a/modules/beast_core/files/RandomAccessFile.h +++ b/modules/beast_core/files/RandomAccessFile.h @@ -20,6 +20,9 @@ #ifndef BEAST_RANDOMACCESSFILE_H_INCLUDED #define BEAST_RANDOMACCESSFILE_H_INCLUDED +namespace beast +{ + /** Provides random access reading and writing to an operating system file. This class wraps the underlying native operating system routines for @@ -191,5 +194,7 @@ private: FileOffset currentPosition; }; +} // namespace beast + #endif diff --git a/modules/beast_core/files/TemporaryFile.cpp b/modules/beast_core/files/TemporaryFile.cpp index e5603da72c..9a91b3d4b5 100644 --- a/modules/beast_core/files/TemporaryFile.cpp +++ b/modules/beast_core/files/TemporaryFile.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + static File createTempFile (const File& parentDirectory, String name, const String& suffix, const int optionFlags) { @@ -110,3 +113,5 @@ bool TemporaryFile::deleteTemporaryFile() const return false; } + +} // namespace beast diff --git a/modules/beast_core/files/TemporaryFile.h b/modules/beast_core/files/TemporaryFile.h index 9bea480aa1..b2f13fd4d5 100644 --- a/modules/beast_core/files/TemporaryFile.h +++ b/modules/beast_core/files/TemporaryFile.h @@ -24,6 +24,9 @@ #ifndef BEAST_TEMPORARYFILE_H_INCLUDED #define BEAST_TEMPORARYFILE_H_INCLUDED +namespace beast +{ + //============================================================================== /** Manages a temporary file, which will be deleted when this object is deleted. @@ -158,4 +161,6 @@ private: const File temporaryFile, targetFile; }; +} // namespace beast + #endif // BEAST_TEMPORARYFILE_H_INCLUDED diff --git a/modules/beast_core/json/JSON.cpp b/modules/beast_core/json/JSON.cpp index ebd6051a94..933245b2f0 100644 --- a/modules/beast_core/json/JSON.cpp +++ b/modules/beast_core/json/JSON.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + class JSONParser { public: @@ -640,3 +643,5 @@ public: }; static JSONTests jsonTests; + +} // namespace beast diff --git a/modules/beast_core/json/JSON.h b/modules/beast_core/json/JSON.h index 6e854f63fc..f17d019c5e 100644 --- a/modules/beast_core/json/JSON.h +++ b/modules/beast_core/json/JSON.h @@ -24,6 +24,9 @@ #ifndef BEAST_JSON_H_INCLUDED #define BEAST_JSON_H_INCLUDED +namespace beast +{ + class InputStream; class OutputStream; class File; @@ -106,5 +109,6 @@ private: JSON(); // This class can't be instantiated - just use its static methods. }; +} // namespace beast #endif // BEAST_JSON_H_INCLUDED diff --git a/modules/beast_core/logging/FileLogger.cpp b/modules/beast_core/logging/FileLogger.cpp index ad654cdf8f..1eba14fe2d 100644 --- a/modules/beast_core/logging/FileLogger.cpp +++ b/modules/beast_core/logging/FileLogger.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + FileLogger::FileLogger (const File& file, const String& welcomeMessage, const int64 maxInitialFileSizeBytes) @@ -127,3 +130,5 @@ FileLogger* FileLogger::createDateStampedLogger (const String& logFileSubDirecto .getNonexistentSibling(), welcomeMessage, 0); } + +} // namespace beast diff --git a/modules/beast_core/logging/FileLogger.h b/modules/beast_core/logging/FileLogger.h index ddf887ee76..bf17d3fa68 100644 --- a/modules/beast_core/logging/FileLogger.h +++ b/modules/beast_core/logging/FileLogger.h @@ -24,6 +24,9 @@ #ifndef BEAST_FILELOGGER_H_INCLUDED #define BEAST_FILELOGGER_H_INCLUDED +namespace beast +{ + //============================================================================== /** A simple implementation of a Logger that writes to a file. @@ -126,5 +129,6 @@ private: void trimFileSize (int64 maxFileSizeBytes) const; }; +} // namespace beast #endif // BEAST_FILELOGGER_H_INCLUDED diff --git a/modules/beast_core/logging/Logger.cpp b/modules/beast_core/logging/Logger.cpp index 5a5f073345..bb3ed1dad5 100644 --- a/modules/beast_core/logging/Logger.cpp +++ b/modules/beast_core/logging/Logger.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + Logger::Logger() {} Logger::~Logger() @@ -56,3 +59,5 @@ void logAssertion (const char* const filename, const int lineNum) noexcept #endif } #endif + +} // namespace beast diff --git a/modules/beast_core/logging/Logger.h b/modules/beast_core/logging/Logger.h index a9935d5f77..1d682e19e6 100644 --- a/modules/beast_core/logging/Logger.h +++ b/modules/beast_core/logging/Logger.h @@ -24,6 +24,9 @@ #ifndef BEAST_LOGGER_H_INCLUDED #define BEAST_LOGGER_H_INCLUDED +namespace beast +{ + //============================================================================== /** Acts as an application-wide logging class. @@ -87,5 +90,6 @@ private: static Logger* currentLogger; }; +} // namespace beast #endif // BEAST_LOGGER_H_INCLUDED diff --git a/modules/beast_core/maths/BigInteger.cpp b/modules/beast_core/maths/BigInteger.cpp index f358981ec1..ff25eedd90 100644 --- a/modules/beast_core/maths/BigInteger.cpp +++ b/modules/beast_core/maths/BigInteger.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + namespace { inline size_t bitToIndex (const int bit) noexcept { return (size_t) (bit >> 5); } @@ -1014,3 +1017,5 @@ void BigInteger::loadFromMemoryBlock (const MemoryBlock& data) for (int i = (int) data.getSize(); --i >= 0;) this->setBitRangeAsInt (i << 3, 8, (uint32) data [i]); } + +} // namespace beast diff --git a/modules/beast_core/maths/BigInteger.h b/modules/beast_core/maths/BigInteger.h index 0d2c2ea7fb..273a6bc7c8 100644 --- a/modules/beast_core/maths/BigInteger.h +++ b/modules/beast_core/maths/BigInteger.h @@ -24,6 +24,9 @@ #ifndef BEAST_BIGINTEGER_H_INCLUDED #define BEAST_BIGINTEGER_H_INCLUDED +namespace beast +{ + //============================================================================== /** An arbitrarily large integer class. @@ -318,5 +321,6 @@ OutputStream& BEAST_CALLTYPE operator<< (OutputStream& stream, const BigInteger& typedef BigInteger BitArray; #endif +} // namespace beast #endif // BEAST_BIGINTEGER_H_INCLUDED diff --git a/modules/beast_core/maths/Math.h b/modules/beast_core/maths/Math.h index b3976656f0..26f5bcfe4f 100644 --- a/modules/beast_core/maths/Math.h +++ b/modules/beast_core/maths/Math.h @@ -20,6 +20,9 @@ #ifndef BEAST_MATH_H_INCLUDED #define BEAST_MATH_H_INCLUDED +namespace beast +{ + // // Miscellaneous mathematical calculations // @@ -81,4 +84,6 @@ inline T radiansToDegrees (U radians) return deg; } +} // namespace beast + #endif diff --git a/modules/beast_core/maths/Random.cpp b/modules/beast_core/maths/Random.cpp index 4e8cf36d5c..2a9fd1c056 100644 --- a/modules/beast_core/maths/Random.cpp +++ b/modules/beast_core/maths/Random.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + Random::Random (const int64 seedValue) noexcept : seed (seedValue) { @@ -185,3 +188,5 @@ public: }; static RandomTests randomTests; + +} // namespace beast diff --git a/modules/beast_core/maths/Random.h b/modules/beast_core/maths/Random.h index 88af60b485..b80dd8066e 100644 --- a/modules/beast_core/maths/Random.h +++ b/modules/beast_core/maths/Random.h @@ -24,6 +24,9 @@ #ifndef BEAST_RANDOM_H_INCLUDED #define BEAST_RANDOM_H_INCLUDED +namespace beast +{ + //============================================================================== /** A random number generator. @@ -129,5 +132,6 @@ private: int64 seed; }; +} // namespace beast #endif // BEAST_RANDOM_H_INCLUDED diff --git a/modules/beast_core/maths/Range.h b/modules/beast_core/maths/Range.h index 48ccf87b4c..e184ebefb9 100644 --- a/modules/beast_core/maths/Range.h +++ b/modules/beast_core/maths/Range.h @@ -25,6 +25,9 @@ #define BEAST_RANGE_H_INCLUDED +namespace beast +{ + //============================================================================== /** A general-purpose range object, that simply represents any linear range with a start and end point. @@ -255,5 +258,6 @@ private: ValueType start, end; }; +} // namespace beast #endif // BEAST_RANGE_H_INCLUDED diff --git a/modules/beast_core/memory/CacheLine.h b/modules/beast_core/memory/CacheLine.h index fbc9c1914e..eba3b1cd12 100644 --- a/modules/beast_core/memory/CacheLine.h +++ b/modules/beast_core/memory/CacheLine.h @@ -25,6 +25,9 @@ // #define GLOBAL_PADDING_ENABLED 1 +namespace beast +{ + namespace CacheLine { @@ -412,6 +415,8 @@ private: T m_t; }; -} +} // namespace CacheLine + +} // namespace beast #endif diff --git a/modules/beast_core/memory/MemoryAlignment.h b/modules/beast_core/memory/MemoryAlignment.h index 0ff5dad1c4..a2928d56e4 100644 --- a/modules/beast_core/memory/MemoryAlignment.h +++ b/modules/beast_core/memory/MemoryAlignment.h @@ -20,6 +20,9 @@ #ifndef BEAST_MEMORYALIGNMENT_H_INCLUDED #define BEAST_MEMORYALIGNMENT_H_INCLUDED +namespace beast +{ + namespace Memory { @@ -62,6 +65,8 @@ inline P* pointerAdjustedForAlignment (P* const p) bytesNeededForAlignment (p)); } -} +} // namespace Memory + +} // namespace beast #endif diff --git a/modules/beast_core/memory/MemoryBlock.cpp b/modules/beast_core/memory/MemoryBlock.cpp index 1d57ece749..9c2e3c13b9 100644 --- a/modules/beast_core/memory/MemoryBlock.cpp +++ b/modules/beast_core/memory/MemoryBlock.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + MemoryBlock::MemoryBlock() noexcept : size (0) { @@ -402,4 +405,6 @@ bool MemoryBlock::fromBase64Encoding (const String& s) } return true; -} \ No newline at end of file +} + +} // namespace beast diff --git a/modules/beast_core/memory/MemoryBlock.h b/modules/beast_core/memory/MemoryBlock.h index b5d9cf0f2d..c411192d0e 100644 --- a/modules/beast_core/memory/MemoryBlock.h +++ b/modules/beast_core/memory/MemoryBlock.h @@ -24,6 +24,9 @@ #ifndef BEAST_MEMORYBLOCK_H_INCLUDED #define BEAST_MEMORYBLOCK_H_INCLUDED +namespace beast +{ + //============================================================================== /** A class to hold a resizable block of raw data. @@ -264,5 +267,7 @@ private: size_t size; }; +} // namespace beast + #endif diff --git a/modules/beast_core/memory/OptionalScopedPointer.h b/modules/beast_core/memory/OptionalScopedPointer.h index 9aeffd7a1f..1c3008f390 100644 --- a/modules/beast_core/memory/OptionalScopedPointer.h +++ b/modules/beast_core/memory/OptionalScopedPointer.h @@ -24,6 +24,9 @@ #ifndef BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED #define BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED +namespace beast +{ + //============================================================================== /** Holds a pointer to an object which can optionally be deleted when this pointer @@ -176,5 +179,6 @@ private: bool shouldDelete; }; +} // namespace beast #endif // BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED diff --git a/modules/beast_core/memory/SharedSingleton.h b/modules/beast_core/memory/SharedSingleton.h index 4e019cb0d8..28b8ee8d37 100644 --- a/modules/beast_core/memory/SharedSingleton.h +++ b/modules/beast_core/memory/SharedSingleton.h @@ -20,6 +20,9 @@ #ifndef BEAST_SHAREDSINGLETON_H_INCLUDED #define BEAST_SHAREDSINGLETON_H_INCLUDED +namespace beast +{ + /** Thread-safe singleton which comes into existence on first use. Use this instead of creating objects with static storage duration. These singletons are automatically reference counted, so if you hold a pointer to it in every @@ -190,4 +193,6 @@ private: //------------------------------------------------------------------------------ +} // namespace beast + #endif diff --git a/modules/beast_core/misc/Main.cpp b/modules/beast_core/misc/Main.cpp index e9ccaf4d8b..1f04b0ecf5 100644 --- a/modules/beast_core/misc/Main.cpp +++ b/modules/beast_core/misc/Main.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + Main* Main::s_instance; Main::Main () @@ -124,3 +127,5 @@ int Main::runFromMain (int argc, char const* const* argv) return exitCode; } + +} // namespace beast diff --git a/modules/beast_core/misc/Main.h b/modules/beast_core/misc/Main.h index 0059b9cc92..25158476d8 100644 --- a/modules/beast_core/misc/Main.h +++ b/modules/beast_core/misc/Main.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_MAIN_H_INCLUDED #define BEAST_CORE_MAIN_H_INCLUDED +namespace beast +{ + /** Represents a command line program's entry point To use this, derive your class from @ref Main and implement the function run (); @@ -75,5 +78,7 @@ private: static Main* s_instance; }; +} // namespace beast + #endif diff --git a/modules/beast_core/misc/Result.cpp b/modules/beast_core/misc/Result.cpp index cf04bbc07b..36dfe59bd1 100644 --- a/modules/beast_core/misc/Result.cpp +++ b/modules/beast_core/misc/Result.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + Result::Result() noexcept {} Result::Result (const String& message) noexcept @@ -76,3 +79,5 @@ bool Result::wasOk() const noexcept { return errorMessage.isEmpty(); } Result::operator bool() const noexcept { return errorMessage.isEmpty(); } bool Result::failed() const noexcept { return errorMessage.isNotEmpty(); } bool Result::operator!() const noexcept { return errorMessage.isNotEmpty(); } + +} // namespace beast diff --git a/modules/beast_core/misc/Result.h b/modules/beast_core/misc/Result.h index d596a8d6a5..661137b2a3 100644 --- a/modules/beast_core/misc/Result.h +++ b/modules/beast_core/misc/Result.h @@ -24,6 +24,9 @@ #ifndef BEAST_RESULT_H_INCLUDED #define BEAST_RESULT_H_INCLUDED +namespace beast +{ + /** Represents the 'success' or 'failure' of an operation, and holds an associated error message to describe the error when there's a failure. @@ -113,5 +116,7 @@ private: operator void*() const; }; +} // namespace beast + #endif diff --git a/modules/beast_core/misc/Uuid.cpp b/modules/beast_core/misc/Uuid.cpp index 3a947f848c..64bae164bf 100644 --- a/modules/beast_core/misc/Uuid.cpp +++ b/modules/beast_core/misc/Uuid.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + namespace { int64 getRandomSeedFromMACAddresses() @@ -107,3 +110,5 @@ Uuid& Uuid::operator= (const uint8* const rawData) noexcept return *this; } + +} // namespace beast diff --git a/modules/beast_core/misc/Uuid.h b/modules/beast_core/misc/Uuid.h index 36b08c43e4..b7a7848d66 100644 --- a/modules/beast_core/misc/Uuid.h +++ b/modules/beast_core/misc/Uuid.h @@ -24,6 +24,9 @@ #ifndef BEAST_UUID_H_INCLUDED #define BEAST_UUID_H_INCLUDED +namespace beast +{ + //============================================================================== /** A universally unique 128-bit identifier. @@ -100,5 +103,6 @@ private: uint8 uuid[16]; }; +} // namespace beast #endif // BEAST_UUID_H_INCLUDED diff --git a/modules/beast_core/misc/WindowsRegistry.h b/modules/beast_core/misc/WindowsRegistry.h index 9d89defd30..504369791b 100644 --- a/modules/beast_core/misc/WindowsRegistry.h +++ b/modules/beast_core/misc/WindowsRegistry.h @@ -24,6 +24,9 @@ #ifndef BEAST_WINDOWSREGISTRY_H_INCLUDED #define BEAST_WINDOWSREGISTRY_H_INCLUDED +namespace beast +{ + #if BEAST_WINDOWS || DOXYGEN /** @@ -115,4 +118,7 @@ private: }; #endif + +} // namespace beast + #endif // BEAST_WINDOWSREGISTRY_H_INCLUDED diff --git a/modules/beast_core/native/android_Files.cpp b/modules/beast_core/native/android_Files.cpp index a789f7e8d3..ec01713a3f 100644 --- a/modules/beast_core/native/android_Files.cpp +++ b/modules/beast_core/native/android_Files.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + bool File::copyInternal (const File& dest) const { FileInputStream in (*this); @@ -233,3 +236,5 @@ bool Process::openDocument (const String& fileName, const String& parameters) void File::revealToUser() const { } + +} // namespace beast diff --git a/modules/beast_core/native/android_JNIHelpers.h b/modules/beast_core/native/android_JNIHelpers.h index 6a4f1f9672..f9c0892817 100644 --- a/modules/beast_core/native/android_JNIHelpers.h +++ b/modules/beast_core/native/android_JNIHelpers.h @@ -24,6 +24,9 @@ #ifndef BEAST_ANDROID_JNIHELPERS_H_INCLUDED #define BEAST_ANDROID_JNIHELPERS_H_INCLUDED +namespace beast +{ + #if ! (defined (BEAST_ANDROID_ACTIVITY_CLASSNAME) && defined (BEAST_ANDROID_ACTIVITY_CLASSPATH)) #error "The BEAST_ANDROID_ACTIVITY_CLASSNAME and BEAST_ANDROID_ACTIVITY_CLASSPATH macros must be set!" #endif @@ -397,4 +400,6 @@ DECLARE_JNI_CLASS (Matrix, "android/graphics/Matrix"); DECLARE_JNI_CLASS (RectClass, "android/graphics/Rect"); #undef JNI_CLASS_MEMBERS +} // namespace beast + #endif // BEAST_ANDROID_JNIHELPERS_H_INCLUDED diff --git a/modules/beast_core/native/android_Misc.cpp b/modules/beast_core/native/android_Misc.cpp index 275fd6e114..fd77f73eb4 100644 --- a/modules/beast_core/native/android_Misc.cpp +++ b/modules/beast_core/native/android_Misc.cpp @@ -21,7 +21,12 @@ */ //============================================================================== +namespace beast +{ + void Logger::outputDebugString (const String& text) { __android_log_print (ANDROID_LOG_INFO, "BEAST", "%", text.toUTF8().getAddress()); } + +} // namespace beast diff --git a/modules/beast_core/native/android_Network.cpp b/modules/beast_core/native/android_Network.cpp index ec2ba4964e..ee0b2091b5 100644 --- a/modules/beast_core/native/android_Network.cpp +++ b/modules/beast_core/native/android_Network.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + //============================================================================== #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "()V") \ @@ -57,3 +60,5 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress, // TODO return false; } + +} // namespace beast diff --git a/modules/beast_core/native/android_SystemStats.cpp b/modules/beast_core/native/android_SystemStats.cpp index fe66fa6df6..c262df3eac 100644 --- a/modules/beast_core/native/android_SystemStats.cpp +++ b/modules/beast_core/native/android_SystemStats.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + JNIClassBase::JNIClassBase (const char* classPath_) : classPath (classPath_), classRef (0) { @@ -299,3 +302,5 @@ bool Time::setSystemTimeToThisTime() const bassertfalse; return false; } + +} // namespace beast diff --git a/modules/beast_core/native/android_Threads.cpp b/modules/beast_core/native/android_Threads.cpp index e36cdf8252..0a32a3547f 100644 --- a/modules/beast_core/native/android_Threads.cpp +++ b/modules/beast_core/native/android_Threads.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in beast_posix_SharedCode.h! @@ -69,3 +72,5 @@ BEAST_API bool BEAST_CALLTYPE Process::isRunningUnderDebugger() void Process::raisePrivilege() {} void Process::lowerPrivilege() {} + +} // namespace beast diff --git a/modules/beast_core/native/bsd_Files.cpp b/modules/beast_core/native/bsd_Files.cpp index 109b947f15..69ba29c81b 100644 --- a/modules/beast_core/native/bsd_Files.cpp +++ b/modules/beast_core/native/bsd_Files.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + enum { U_ISOFS_SUPER_MAGIC = 5, @@ -367,3 +370,5 @@ void File::revealToUser() const else if (getParentDirectory().exists()) getParentDirectory().startAsProcess(); } + +} // namespace beast diff --git a/modules/beast_core/native/bsd_Network.cpp b/modules/beast_core/native/bsd_Network.cpp index 9fb630149d..6a7a88eed4 100644 --- a/modules/beast_core/native/bsd_Network.cpp +++ b/modules/beast_core/native/bsd_Network.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + void MACAddress::findAllAddresses (Array& result) { ifaddrs* addrs = nullptr; @@ -57,3 +60,5 @@ bool Process::openEmailWithAttachments (const String& /* targetEmailAddress */, return false; } + +} // namespace beast diff --git a/modules/beast_core/native/bsd_SystemStats.cpp b/modules/beast_core/native/bsd_SystemStats.cpp index e5ce2ec208..f4e288e591 100644 --- a/modules/beast_core/native/bsd_SystemStats.cpp +++ b/modules/beast_core/native/bsd_SystemStats.cpp @@ -52,6 +52,9 @@ * */ +namespace beast +{ + #define SI_LOAD_SHIFT 16 struct sysinfo { long uptime; /* Seconds since boot */ @@ -349,3 +352,5 @@ bool Time::setSystemTimeToThisTime() const return settimeofday (&t, 0) == 0; } + +} // namespace beast diff --git a/modules/beast_core/native/bsd_Threads.cpp b/modules/beast_core/native/bsd_Threads.cpp index 5573fc48db..680b9fbf2a 100644 --- a/modules/beast_core/native/bsd_Threads.cpp +++ b/modules/beast_core/native/bsd_Threads.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in beast_posix_SharedCode.h! @@ -67,3 +70,5 @@ static void swapUserAndEffectiveUser() void Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); } void Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); } + +} // namespace beast diff --git a/modules/beast_core/native/linux_Files.cpp b/modules/beast_core/native/linux_Files.cpp index 3a9aa88cf3..1f05ee0f9d 100644 --- a/modules/beast_core/native/linux_Files.cpp +++ b/modules/beast_core/native/linux_Files.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + enum { U_ISOFS_SUPER_MAGIC = 0x9660, // linux/iso_fs.h @@ -367,3 +370,5 @@ void File::revealToUser() const else if (getParentDirectory().exists()) getParentDirectory().startAsProcess(); } + +} // namespace beast diff --git a/modules/beast_core/native/linux_Network.cpp b/modules/beast_core/native/linux_Network.cpp index 38046c496d..a182bc233b 100644 --- a/modules/beast_core/native/linux_Network.cpp +++ b/modules/beast_core/native/linux_Network.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + void MACAddress::findAllAddresses (Array& result) { const int s = socket (AF_INET, SOCK_DGRAM, 0); @@ -59,3 +62,5 @@ bool Process::openEmailWithAttachments (const String& /* targetEmailAddress */, return false; } + +} // namespace beast diff --git a/modules/beast_core/native/linux_SystemStats.cpp b/modules/beast_core/native/linux_SystemStats.cpp index 5fce6d211d..f74c06671a 100644 --- a/modules/beast_core/native/linux_SystemStats.cpp +++ b/modules/beast_core/native/linux_SystemStats.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + void Logger::outputDebugString (const String& text) { std::cerr << text << std::endl; @@ -174,3 +177,5 @@ bool Time::setSystemTimeToThisTime() const return settimeofday (&t, 0) == 0; } + +} // namespace beast diff --git a/modules/beast_core/native/linux_Threads.cpp b/modules/beast_core/native/linux_Threads.cpp index 795bebc047..64af66fc4b 100644 --- a/modules/beast_core/native/linux_Threads.cpp +++ b/modules/beast_core/native/linux_Threads.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in beast_posix_SharedCode.h! @@ -78,3 +81,5 @@ static void swapUserAndEffectiveUser() void Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); } void Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); } + +} // namespace beast diff --git a/modules/beast_core/native/mac_Files.mm b/modules/beast_core/native/mac_Files.mm index 03e8fe7c39..dc2ad72b7d 100644 --- a/modules/beast_core/native/mac_Files.mm +++ b/modules/beast_core/native/mac_Files.mm @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in beast_posix_SharedCode.h! @@ -477,3 +480,5 @@ void File::addToDock() const } } #endif + +} // namespace beast diff --git a/modules/beast_core/native/mac_Network.mm b/modules/beast_core/native/mac_Network.mm index b8e2d74ae5..4fe1fe6b3b 100644 --- a/modules/beast_core/native/mac_Network.mm +++ b/modules/beast_core/native/mac_Network.mm @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + void MACAddress::findAllAddresses (Array& result) { ifaddrs* addrs = nullptr; @@ -95,3 +98,5 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress, } #endif } + +} // namespace beast diff --git a/modules/beast_core/native/mac_Strings.mm b/modules/beast_core/native/mac_Strings.mm index 4b1cb88678..befece2cfc 100644 --- a/modules/beast_core/native/mac_Strings.mm +++ b/modules/beast_core/native/mac_Strings.mm @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + String String::fromCFString (CFStringRef cfString) { if (cfString == 0) @@ -89,3 +92,5 @@ String String::convertToPrecomposedUnicode() const return result; #endif } + +} // namespace beast diff --git a/modules/beast_core/native/mac_SystemStats.mm b/modules/beast_core/native/mac_SystemStats.mm index 39e9fb941a..040f5a7330 100644 --- a/modules/beast_core/native/mac_SystemStats.mm +++ b/modules/beast_core/native/mac_SystemStats.mm @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + ScopedAutoReleasePool::ScopedAutoReleasePool() { pool = [[NSAutoreleasePool alloc] init]; @@ -289,3 +292,5 @@ int SystemStats::getPageSize() { return (int) NSPageSize(); } + +} // namespace beast diff --git a/modules/beast_core/native/mac_Threads.mm b/modules/beast_core/native/mac_Threads.mm index f40d7b2593..fd64ed6c9b 100644 --- a/modules/beast_core/native/mac_Threads.mm +++ b/modules/beast_core/native/mac_Threads.mm @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + /* Note that a lot of methods that you'd expect to find in this file actually live in beast_posix_SharedCode.h! @@ -79,3 +82,5 @@ BEAST_API bool BEAST_CALLTYPE Process::isRunningUnderDebugger() { return beast_isRunningUnderDebugger(); } + +} // namespace beast diff --git a/modules/beast_core/native/osx_ObjCHelpers.h b/modules/beast_core/native/osx_ObjCHelpers.h index 42743eedec..d4f19bc719 100644 --- a/modules/beast_core/native/osx_ObjCHelpers.h +++ b/modules/beast_core/native/osx_ObjCHelpers.h @@ -24,6 +24,9 @@ #ifndef BEAST_OSX_OBJCHELPERS_H_INCLUDED #define BEAST_OSX_OBJCHELPERS_H_INCLUDED +namespace beast +{ + /* This file contains a few helper functions that are used internally but which need to be kept away from the public headers because they use obj-C symbols. */ @@ -146,5 +149,6 @@ private: } }; +} // namespace beast #endif // BEAST_OSX_OBJCHELPERS_H_INCLUDED diff --git a/modules/beast_core/native/posix_FPUFlags.cpp b/modules/beast_core/native/posix_FPUFlags.cpp index 0b0d476c12..5fc31f95e4 100644 --- a/modules/beast_core/native/posix_FPUFlags.cpp +++ b/modules/beast_core/native/posix_FPUFlags.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + //#pragma message(BEAST_FILEANDLINE_ "Missing platform-specific implementation") FPUFlags FPUFlags::getCurrent () @@ -27,3 +30,5 @@ FPUFlags FPUFlags::getCurrent () void FPUFlags::setCurrent (const FPUFlags& flags) { } + +} // namespace beast diff --git a/modules/beast_core/native/posix_SharedCode.h b/modules/beast_core/native/posix_SharedCode.h index 4d72928d40..01d151a998 100644 --- a/modules/beast_core/native/posix_SharedCode.h +++ b/modules/beast_core/native/posix_SharedCode.h @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + CriticalSection::CriticalSection() noexcept { pthread_mutexattr_t atts; @@ -1207,3 +1210,5 @@ private: #endif } }; + +} // namespace beast diff --git a/modules/beast_core/native/win32_ComSmartPtr.h b/modules/beast_core/native/win32_ComSmartPtr.h index 03c9380acd..f704a8e70b 100644 --- a/modules/beast_core/native/win32_ComSmartPtr.h +++ b/modules/beast_core/native/win32_ComSmartPtr.h @@ -24,6 +24,9 @@ #ifndef BEAST_WIN32_COMSMARTPTR_H_INCLUDED #define BEAST_WIN32_COMSMARTPTR_H_INCLUDED +namespace beast +{ + #ifndef _MSC_VER template struct UUIDGetter { static CLSID get() { bassertfalse; return CLSID(); } }; #define __uuidof(x) UUIDGetter::get() @@ -162,4 +165,6 @@ public: } }; +} // namespace beast + #endif // BEAST_WIN32_COMSMARTPTR_H_INCLUDED diff --git a/modules/beast_core/native/win32_FPUFlags.cpp b/modules/beast_core/native/win32_FPUFlags.cpp index a21354d448..ca6fc7c05b 100644 --- a/modules/beast_core/native/win32_FPUFlags.cpp +++ b/modules/beast_core/native/win32_FPUFlags.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + FPUFlags FPUFlags::getCurrent () { unsigned int currentControl; @@ -174,3 +177,5 @@ void FPUFlags::setCurrent (const FPUFlags& flags) if (result != 0) Throw (std::runtime_error ("error in _controlfp_s")); } + +} // namespace beast diff --git a/modules/beast_core/native/win32_Files.cpp b/modules/beast_core/native/win32_Files.cpp index 5767925b5b..6eb7275d0f 100644 --- a/modules/beast_core/native/win32_Files.cpp +++ b/modules/beast_core/native/win32_Files.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + #ifndef INVALID_FILE_ATTRIBUTES #define INVALID_FILE_ATTRIBUTES ((DWORD) -1) #endif @@ -883,3 +886,5 @@ void File::revealToUser() const } } } + +} // beast diff --git a/modules/beast_core/native/win32_Network.cpp b/modules/beast_core/native/win32_Network.cpp index 231b897ab5..37deb8be29 100644 --- a/modules/beast_core/native/win32_Network.cpp +++ b/modules/beast_core/native/win32_Network.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + struct GetAdaptersInfoHelper { bool callGetAdaptersInfo() @@ -152,3 +155,5 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress, return mapiSendMail (0, 0, &message, MAPI_DIALOG | MAPI_LOGON_UI, 0) == SUCCESS_SUCCESS; } + +} // namespace beast diff --git a/modules/beast_core/native/win32_Registry.cpp b/modules/beast_core/native/win32_Registry.cpp index 467323852a..c2a09204fc 100644 --- a/modules/beast_core/native/win32_Registry.cpp +++ b/modules/beast_core/native/win32_Registry.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + struct RegistryKeyWrapper : public Uncopyable { RegistryKeyWrapper (String name, const bool createForWriting, const DWORD wow64Flags) @@ -212,3 +215,5 @@ bool WindowsRegistry::registerFileAssociation (const String& fileExtension, || setValue (key + "\\DefaultIcon\\", targetExecutable.getFullPathName() + "," + String (-iconResourceNumber))); } + +} // namespace beast diff --git a/modules/beast_core/native/win32_SystemStats.cpp b/modules/beast_core/native/win32_SystemStats.cpp index c4f1f8ca4e..56e892aaab 100644 --- a/modules/beast_core/native/win32_SystemStats.cpp +++ b/modules/beast_core/native/win32_SystemStats.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + void Logger::outputDebugString (const String& text) { OutputDebugString ((text + "\n").toWideCharPointer()); @@ -416,3 +419,5 @@ String SystemStats::getDisplayLanguage() return "en"; } + +} // namespace beast diff --git a/modules/beast_core/native/win32_Threads.cpp b/modules/beast_core/native/win32_Threads.cpp index 019a6d900e..bb38984b0f 100644 --- a/modules/beast_core/native/win32_Threads.cpp +++ b/modules/beast_core/native/win32_Threads.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + void* getUser32Function (const char* functionName) { HMODULE module = GetModuleHandleA ("user32.dll"); @@ -450,3 +453,5 @@ private: timer->owner.hiResTimerCallback(); } }; + +} // namespace beast diff --git a/modules/beast_core/network/MACAddress.cpp b/modules/beast_core/network/MACAddress.cpp index d9de043f76..abcf4f536c 100644 --- a/modules/beast_core/network/MACAddress.cpp +++ b/modules/beast_core/network/MACAddress.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + MACAddress::MACAddress() { zeromem (address, sizeof (address)); @@ -71,3 +74,5 @@ bool MACAddress::isNull() const noexcept { return bool MACAddress::operator== (const MACAddress& other) const noexcept { return memcmp (address, other.address, sizeof (address)) == 0; } bool MACAddress::operator!= (const MACAddress& other) const noexcept { return ! operator== (other); } + +} // namespace beast diff --git a/modules/beast_core/network/MACAddress.h b/modules/beast_core/network/MACAddress.h index 24e003c097..dd8d3a643a 100644 --- a/modules/beast_core/network/MACAddress.h +++ b/modules/beast_core/network/MACAddress.h @@ -24,6 +24,9 @@ #ifndef BEAST_MACADDRESS_H_INCLUDED #define BEAST_MACADDRESS_H_INCLUDED +namespace beast +{ + //============================================================================== /** A wrapper for a streaming (TCP) socket. @@ -77,5 +80,6 @@ private: uint8 address[6]; }; +} // namespace beast #endif // BEAST_MACADDRESS_H_INCLUDED diff --git a/modules/beast_core/network/NamedPipe.cpp b/modules/beast_core/network/NamedPipe.cpp index c46cae3b7d..dd8e77bbc9 100644 --- a/modules/beast_core/network/NamedPipe.cpp +++ b/modules/beast_core/network/NamedPipe.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + NamedPipe::NamedPipe() { } @@ -59,3 +62,5 @@ String NamedPipe::getName() const } // other methods for this class are implemented in the platform-specific files + +} // namespace beast diff --git a/modules/beast_core/network/NamedPipe.h b/modules/beast_core/network/NamedPipe.h index 2f59ba4a12..530593a325 100644 --- a/modules/beast_core/network/NamedPipe.h +++ b/modules/beast_core/network/NamedPipe.h @@ -24,6 +24,9 @@ #ifndef BEAST_NAMEDPIPE_H_INCLUDED #define BEAST_NAMEDPIPE_H_INCLUDED +namespace beast +{ + //============================================================================== /** A cross-process pipe that can have data written to and read from it. @@ -92,5 +95,6 @@ private: bool openInternal (const String& pipeName, const bool createPipe); }; +} // namespace beast #endif // BEAST_NAMEDPIPE_H_INCLUDED diff --git a/modules/beast_core/network/Socket.cpp b/modules/beast_core/network/Socket.cpp index 60e997d2b7..77bb82f9f9 100644 --- a/modules/beast_core/network/Socket.cpp +++ b/modules/beast_core/network/Socket.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + #if BEAST_MSVC #pragma warning (push) #pragma warning (disable : 4127 4389 4018) @@ -583,3 +586,5 @@ bool DatagramSocket::isLocal() const noexcept #if BEAST_MSVC #pragma warning (pop) #endif + +} // namespace beast diff --git a/modules/beast_core/network/Socket.h b/modules/beast_core/network/Socket.h index 734f0c6c6a..125408f87a 100644 --- a/modules/beast_core/network/Socket.h +++ b/modules/beast_core/network/Socket.h @@ -24,6 +24,9 @@ #ifndef BEAST_SOCKET_H_INCLUDED #define BEAST_SOCKET_H_INCLUDED +namespace beast +{ + //============================================================================== /** A wrapper for a streaming (TCP) socket. @@ -291,5 +294,6 @@ private: DatagramSocket (const String& hostname, int portNumber, int handle, int localPortNumber); }; +} // namespace beast #endif // BEAST_SOCKET_H_INCLUDED diff --git a/modules/beast_core/streams/BufferedInputStream.cpp b/modules/beast_core/streams/BufferedInputStream.cpp index 8fcb738681..2b858beaff 100644 --- a/modules/beast_core/streams/BufferedInputStream.cpp +++ b/modules/beast_core/streams/BufferedInputStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + namespace { int calcBufferStreamBufferSize (int requestedSize, InputStream* const source) noexcept @@ -191,3 +194,5 @@ String BufferedInputStream::readString() return InputStream::readString(); } + +} // namespace beast diff --git a/modules/beast_core/streams/BufferedInputStream.h b/modules/beast_core/streams/BufferedInputStream.h index 8f55ee42e8..d50121273c 100644 --- a/modules/beast_core/streams/BufferedInputStream.h +++ b/modules/beast_core/streams/BufferedInputStream.h @@ -24,6 +24,9 @@ #ifndef BEAST_BUFFEREDINPUTSTREAM_H_INCLUDED #define BEAST_BUFFEREDINPUTSTREAM_H_INCLUDED +namespace beast +{ + //============================================================================== /** Wraps another input stream, and reads from it using an intermediate buffer @@ -83,4 +86,6 @@ private: void ensureBuffered(); }; +} // namespace beast + #endif // BEAST_BUFFEREDINPUTSTREAM_H_INCLUDED diff --git a/modules/beast_core/streams/FileInputSource.cpp b/modules/beast_core/streams/FileInputSource.cpp index a2f677dcd5..5248a4d602 100644 --- a/modules/beast_core/streams/FileInputSource.cpp +++ b/modules/beast_core/streams/FileInputSource.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + FileInputSource::FileInputSource (const File& f, bool useFileTimeInHash) : file (f), useFileTimeInHashGeneration (useFileTimeInHash) { @@ -49,3 +52,5 @@ int64 FileInputSource::hashCode() const return h; } + +} // namespace beast diff --git a/modules/beast_core/streams/FileInputSource.h b/modules/beast_core/streams/FileInputSource.h index 63149434c1..b0f8dd91d2 100644 --- a/modules/beast_core/streams/FileInputSource.h +++ b/modules/beast_core/streams/FileInputSource.h @@ -24,6 +24,9 @@ #ifndef BEAST_FILEINPUTSOURCE_H_INCLUDED #define BEAST_FILEINPUTSOURCE_H_INCLUDED +namespace beast +{ + //============================================================================== /** A type of InputSource that represents a normal file. @@ -57,5 +60,6 @@ private: bool useFileTimeInHashGeneration; }; +} // namespace beast #endif // BEAST_FILEINPUTSOURCE_H_INCLUDED diff --git a/modules/beast_core/streams/InputSource.h b/modules/beast_core/streams/InputSource.h index ec1c386087..9653fa4999 100644 --- a/modules/beast_core/streams/InputSource.h +++ b/modules/beast_core/streams/InputSource.h @@ -24,6 +24,9 @@ #ifndef BEAST_INPUTSOURCE_H_INCLUDED #define BEAST_INPUTSOURCE_H_INCLUDED +namespace beast +{ + //============================================================================== /** A lightweight object that can create a stream to read some kind of resource. @@ -63,5 +66,6 @@ public: virtual int64 hashCode() const = 0; }; +} // namespace beast #endif // BEAST_INPUTSOURCE_H_INCLUDED diff --git a/modules/beast_core/streams/InputStream.cpp b/modules/beast_core/streams/InputStream.cpp index 17360a1e49..c883c039e5 100644 --- a/modules/beast_core/streams/InputStream.cpp +++ b/modules/beast_core/streams/InputStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + int64 InputStream::getNumBytesRemaining() { int64 len = getTotalLength(); @@ -320,3 +323,4 @@ float InputStream::readTypeBigEndian () { return readFloatBigEndian (); template <> double InputStream::readTypeBigEndian () { return readDoubleBigEndian (); } +} // namespace beast diff --git a/modules/beast_core/streams/InputStream.h b/modules/beast_core/streams/InputStream.h index 3c32dd448d..9944981c3f 100644 --- a/modules/beast_core/streams/InputStream.h +++ b/modules/beast_core/streams/InputStream.h @@ -24,6 +24,9 @@ #ifndef BEAST_INPUTSTREAM_H_INCLUDED #define BEAST_INPUTSTREAM_H_INCLUDED +namespace beast +{ + class MemoryBlock; //============================================================================== @@ -352,4 +355,6 @@ protected: InputStream() noexcept {} }; +} // namespace beast + #endif diff --git a/modules/beast_core/streams/MemoryInputStream.cpp b/modules/beast_core/streams/MemoryInputStream.cpp index e0679c60f8..7d354b8c45 100644 --- a/modules/beast_core/streams/MemoryInputStream.cpp +++ b/modules/beast_core/streams/MemoryInputStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + MemoryInputStream::MemoryInputStream (const void* const sourceData, const size_t sourceDataSize, const bool keepInternalCopy) @@ -149,3 +152,5 @@ public: }; static MemoryStreamTests memoryStreamTests; + +} // namespace beast diff --git a/modules/beast_core/streams/MemoryInputStream.h b/modules/beast_core/streams/MemoryInputStream.h index 24c8c063cf..a6a7d5dd90 100644 --- a/modules/beast_core/streams/MemoryInputStream.h +++ b/modules/beast_core/streams/MemoryInputStream.h @@ -24,6 +24,9 @@ #ifndef BEAST_MEMORYINPUTSTREAM_H_INCLUDED #define BEAST_MEMORYINPUTSTREAM_H_INCLUDED +namespace beast +{ + //============================================================================== /** Allows a block of data to be accessed as a stream. @@ -88,4 +91,6 @@ private: void createInternalCopy(); }; +} // namespace beast + #endif // BEAST_MEMORYINPUTSTREAM_H_INCLUDED diff --git a/modules/beast_core/streams/MemoryOutputStream.cpp b/modules/beast_core/streams/MemoryOutputStream.cpp index 8df895da1b..34005a8029 100644 --- a/modules/beast_core/streams/MemoryOutputStream.cpp +++ b/modules/beast_core/streams/MemoryOutputStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + MemoryOutputStream::MemoryOutputStream (const size_t initialSize) : blockToUse (&internalBlock), externalData (nullptr), position (0), size (0), availableSize (0) @@ -206,4 +209,6 @@ OutputStream& BEAST_CALLTYPE operator<< (OutputStream& stream, const MemoryOutpu stream.write (streamToRead.getData(), dataSize); return stream; -} \ No newline at end of file +} + +} // namespace beast diff --git a/modules/beast_core/streams/MemoryOutputStream.h b/modules/beast_core/streams/MemoryOutputStream.h index e51f395ebb..80514f27ad 100644 --- a/modules/beast_core/streams/MemoryOutputStream.h +++ b/modules/beast_core/streams/MemoryOutputStream.h @@ -24,6 +24,9 @@ #ifndef BEAST_MEMORYOUTPUTSTREAM_H_INCLUDED #define BEAST_MEMORYOUTPUTSTREAM_H_INCLUDED +namespace beast +{ + //============================================================================== /** Writes data to an internal memory buffer, which grows as required. @@ -137,4 +140,6 @@ private: /** Copies all the data that has been written to a MemoryOutputStream into another stream. */ OutputStream& BEAST_CALLTYPE operator<< (OutputStream& stream, const MemoryOutputStream& streamToRead); -#endif \ No newline at end of file +} // namespace beast + +#endif diff --git a/modules/beast_core/streams/OutputStream.cpp b/modules/beast_core/streams/OutputStream.cpp index 26b91d8e02..af70c88dcf 100644 --- a/modules/beast_core/streams/OutputStream.cpp +++ b/modules/beast_core/streams/OutputStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + #if BEAST_DEBUG struct DanglingStreamChecker @@ -431,3 +434,5 @@ BEAST_API OutputStream& BEAST_CALLTYPE operator<< (OutputStream& stream, const S return stream; } + +} // namespace beast diff --git a/modules/beast_core/streams/OutputStream.h b/modules/beast_core/streams/OutputStream.h index 89ca7ca478..1a35622e95 100644 --- a/modules/beast_core/streams/OutputStream.h +++ b/modules/beast_core/streams/OutputStream.h @@ -24,6 +24,9 @@ #ifndef BEAST_OUTPUTSTREAM_H_INCLUDED #define BEAST_OUTPUTSTREAM_H_INCLUDED +namespace beast +{ + class InputStream; class MemoryBlock; class File; @@ -296,4 +299,6 @@ BEAST_API OutputStream& BEAST_CALLTYPE operator<< (OutputStream& stream, const N /** Writes a string to an OutputStream as UTF8. */ BEAST_API OutputStream& BEAST_CALLTYPE operator<< (OutputStream& stream, const String& stringToWrite); +} // namespace beast + #endif diff --git a/modules/beast_core/streams/SubregionStream.cpp b/modules/beast_core/streams/SubregionStream.cpp index 158b99a06c..e0d0ffccf6 100644 --- a/modules/beast_core/streams/SubregionStream.cpp +++ b/modules/beast_core/streams/SubregionStream.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + SubregionStream::SubregionStream (InputStream* const sourceStream, const int64 start, const int64 length, const bool deleteSourceWhenDestroyed) @@ -75,3 +78,5 @@ bool SubregionStream::isExhausted() return source->isExhausted(); } + +} // namespace beast diff --git a/modules/beast_core/streams/SubregionStream.h b/modules/beast_core/streams/SubregionStream.h index c61cf7fd8a..b423fda13e 100644 --- a/modules/beast_core/streams/SubregionStream.h +++ b/modules/beast_core/streams/SubregionStream.h @@ -24,6 +24,9 @@ #ifndef BEAST_SUBREGIONSTREAM_H_INCLUDED #define BEAST_SUBREGIONSTREAM_H_INCLUDED +namespace beast +{ + //============================================================================== /** Wraps another input stream, and reads from a specific part of it. @@ -80,4 +83,6 @@ private: const int64 startPositionInSourceStream, lengthOfSourceStream; }; +} // namespace beast + #endif // BEAST_SUBREGIONSTREAM_H_INCLUDED diff --git a/modules/beast_core/system/Functional.h b/modules/beast_core/system/Functional.h index f8aaba2c33..eed61a9a19 100644 --- a/modules/beast_core/system/Functional.h +++ b/modules/beast_core/system/Functional.h @@ -20,6 +20,9 @@ #ifndef BEAST_FUNCTIONAL_H_INCLUDED #define BEAST_FUNCTIONAL_H_INCLUDED +namespace beast +{ + //------------------------------------------------------------------------------ /* Brings functional support into our namespace, based on environment. @@ -373,4 +376,6 @@ using namespace placeholders; #endif +} // namespace beast + #endif diff --git a/modules/beast_core/system/SystemStats.cpp b/modules/beast_core/system/SystemStats.cpp index cb600a3697..c9caeddf52 100644 --- a/modules/beast_core/system/SystemStats.cpp +++ b/modules/beast_core/system/SystemStats.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + String SystemStats::getBeastVersion() { // Some basic tests, to keep an eye on things and make sure these types work ok @@ -158,3 +161,5 @@ void SystemStats::setApplicationCrashHandler (CrashHandlerFunction handler) } #endif } + +} // namespace beast diff --git a/modules/beast_core/system/SystemStats.h b/modules/beast_core/system/SystemStats.h index 05c447aac3..d0b7682a4d 100644 --- a/modules/beast_core/system/SystemStats.h +++ b/modules/beast_core/system/SystemStats.h @@ -24,6 +24,9 @@ #ifndef BEAST_SYSTEMSTATS_H_INCLUDED #define BEAST_SYSTEMSTATS_H_INCLUDED +namespace beast +{ + //============================================================================== /** Contains methods for finding out about the current hardware and OS configuration. @@ -177,5 +180,6 @@ private: SystemStats(); }; +} // namespace beast #endif // BEAST_SYSTEMSTATS_H_INCLUDED diff --git a/modules/beast_core/text/Identifier.cpp b/modules/beast_core/text/Identifier.cpp index f003ad0034..acc1971bcd 100644 --- a/modules/beast_core/text/Identifier.cpp +++ b/modules/beast_core/text/Identifier.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + StringPool& Identifier::getPool() { static StringPool pool; @@ -67,3 +70,5 @@ bool Identifier::isValidIdentifier (const String& possibleIdentifier) noexcept return possibleIdentifier.isNotEmpty() && possibleIdentifier.containsOnly ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-:#@$%"); } + +} // namespace beast diff --git a/modules/beast_core/text/Identifier.h b/modules/beast_core/text/Identifier.h index d9bdf7ef89..beb471d82b 100644 --- a/modules/beast_core/text/Identifier.h +++ b/modules/beast_core/text/Identifier.h @@ -24,6 +24,9 @@ #ifndef BEAST_IDENTIFIER_H_INCLUDED #define BEAST_IDENTIFIER_H_INCLUDED +namespace beast +{ + class StringPool; @@ -102,5 +105,6 @@ private: static StringPool& getPool(); }; +} // namespace beast #endif // BEAST_IDENTIFIER_H_INCLUDED diff --git a/modules/beast_core/text/LexicalCast.cpp b/modules/beast_core/text/LexicalCast.cpp index 76165bca5c..a074d7712e 100644 --- a/modules/beast_core/text/LexicalCast.cpp +++ b/modules/beast_core/text/LexicalCast.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + unsigned char const LexicalCastUtilities::s_digitTable [256] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 0xFF - 0x07 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 0x08 - 0x0F @@ -121,3 +124,5 @@ public: }; static LexicalCastTests lexicalCastTests; + +} // namespace beast diff --git a/modules/beast_core/text/LexicalCast.h b/modules/beast_core/text/LexicalCast.h index 20ac2e58a4..3995191053 100644 --- a/modules/beast_core/text/LexicalCast.h +++ b/modules/beast_core/text/LexicalCast.h @@ -20,6 +20,9 @@ #ifndef BEAST_LEXICALCAST_H_INCLUDED #define BEAST_LEXICALCAST_H_INCLUDED +namespace beast +{ + // Base class with utility functions struct LexicalCastUtilities { @@ -300,4 +303,6 @@ Out lexicalCast (In in, Out defaultValue = Out ()) return defaultValue; } +} // namespace beast + #endif diff --git a/modules/beast_core/text/LocalisedStrings.cpp b/modules/beast_core/text/LocalisedStrings.cpp index ca734b4780..d39740207f 100644 --- a/modules/beast_core/text/LocalisedStrings.cpp +++ b/modules/beast_core/text/LocalisedStrings.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + LocalisedStrings::LocalisedStrings (const String& fileContents, bool ignoreCase) { loadFromText (fileContents, ignoreCase); @@ -166,3 +169,5 @@ String translate (const String& text, const String& resultIfNotFound) return resultIfNotFound; } + +} // namespace beast diff --git a/modules/beast_core/text/LocalisedStrings.h b/modules/beast_core/text/LocalisedStrings.h index be0b0ba43d..ae7c523d0c 100644 --- a/modules/beast_core/text/LocalisedStrings.h +++ b/modules/beast_core/text/LocalisedStrings.h @@ -24,6 +24,9 @@ #ifndef BEAST_LOCALISEDSTRINGS_H_INCLUDED #define BEAST_LOCALISEDSTRINGS_H_INCLUDED +namespace beast +{ + //============================================================================== /** Used to convert strings to localised foreign-language versions. @@ -215,5 +218,6 @@ String translate (CharPointer_UTF8 stringLiteral); */ String translate (const String& stringLiteral, const String& resultIfNotFound); +} // namespace beast #endif // BEAST_LOCALISEDSTRINGS_H_INCLUDED diff --git a/modules/beast_core/text/StringArray.cpp b/modules/beast_core/text/StringArray.cpp index 98d34ffd9d..1d74a40ba4 100644 --- a/modules/beast_core/text/StringArray.cpp +++ b/modules/beast_core/text/StringArray.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + StringArray::StringArray() noexcept { } @@ -508,3 +511,5 @@ void StringArray::minimiseStorageOverheads() { strings.minimiseStorageOverheads(); } + +} // namespace beast diff --git a/modules/beast_core/text/StringArray.h b/modules/beast_core/text/StringArray.h index 5150784707..c37e24894a 100644 --- a/modules/beast_core/text/StringArray.h +++ b/modules/beast_core/text/StringArray.h @@ -24,6 +24,9 @@ #ifndef BEAST_STRINGARRAY_H_INCLUDED #define BEAST_STRINGARRAY_H_INCLUDED +namespace beast +{ + //============================================================================== /** A special array for holding a list of strings. @@ -404,5 +407,6 @@ private: Array strings; }; +} // namespace beast #endif // BEAST_STRINGARRAY_H_INCLUDED diff --git a/modules/beast_core/text/StringPairArray.cpp b/modules/beast_core/text/StringPairArray.cpp index 70084c4def..db1227e170 100644 --- a/modules/beast_core/text/StringPairArray.cpp +++ b/modules/beast_core/text/StringPairArray.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + StringPairArray::StringPairArray (const bool ignoreCase_) : ignoreCase (ignoreCase_) { @@ -142,3 +145,5 @@ void StringPairArray::minimiseStorageOverheads() keys.minimiseStorageOverheads(); values.minimiseStorageOverheads(); } + +} // namespace beast diff --git a/modules/beast_core/text/StringPairArray.h b/modules/beast_core/text/StringPairArray.h index 141c552265..7200e12005 100644 --- a/modules/beast_core/text/StringPairArray.h +++ b/modules/beast_core/text/StringPairArray.h @@ -24,6 +24,9 @@ #ifndef BEAST_STRINGPAIRARRAY_H_INCLUDED #define BEAST_STRINGPAIRARRAY_H_INCLUDED +namespace beast +{ + //============================================================================== /** A container for holding a set of strings which are keyed by another string. @@ -152,5 +155,6 @@ private: bool ignoreCase; }; +} // namespace beast #endif // BEAST_STRINGPAIRARRAY_H_INCLUDED diff --git a/modules/beast_core/text/StringPool.cpp b/modules/beast_core/text/StringPool.cpp index b86188244f..5e43a2cf15 100644 --- a/modules/beast_core/text/StringPool.cpp +++ b/modules/beast_core/text/StringPool.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + StringPool::StringPool() noexcept {} StringPool::~StringPool() {} @@ -107,3 +110,5 @@ String::CharPointerType StringPool::operator[] (const int index) const noexcept { return strings [index].getCharPointer(); } + +} // namespace beast diff --git a/modules/beast_core/text/StringPool.h b/modules/beast_core/text/StringPool.h index aa311c6682..cdd948f601 100644 --- a/modules/beast_core/text/StringPool.h +++ b/modules/beast_core/text/StringPool.h @@ -24,6 +24,9 @@ #ifndef BEAST_STRINGPOOL_H_INCLUDED #define BEAST_STRINGPOOL_H_INCLUDED +namespace beast +{ + //============================================================================== /** A StringPool holds a set of shared strings, which reduces storage overheads and improves @@ -82,5 +85,6 @@ private: CriticalSection lock; }; +} // namespace beast #endif // BEAST_STRINGPOOL_H_INCLUDED diff --git a/modules/beast_core/thread/DeadlineTimer.cpp b/modules/beast_core/thread/DeadlineTimer.cpp index 88bbc9e822..f96b77a8b8 100644 --- a/modules/beast_core/thread/DeadlineTimer.cpp +++ b/modules/beast_core/thread/DeadlineTimer.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + class DeadlineTimer::Manager : public LeakChecked , protected Thread @@ -241,3 +244,5 @@ void DeadlineTimer::setRecurringExpiration (double secondsUntilDeadline) m_manager->activate (*this, secondsUntilDeadline, when); } + +} // namespace beast diff --git a/modules/beast_core/thread/DeadlineTimer.h b/modules/beast_core/thread/DeadlineTimer.h index e8d8540a65..af4a5f69b2 100644 --- a/modules/beast_core/thread/DeadlineTimer.h +++ b/modules/beast_core/thread/DeadlineTimer.h @@ -20,6 +20,9 @@ #ifndef BEAST_DEADLINETIMER_H_INCLUDED #define BEAST_DEADLINETIMER_H_INCLUDED +namespace beast +{ + /** Provides periodic or one time notifications at a specified time interval. */ class DeadlineTimer @@ -108,4 +111,6 @@ private: double m_secondsRecurring; // non zero if recurring }; +} // namespace beast + #endif diff --git a/modules/beast_core/thread/MutexTraits.h b/modules/beast_core/thread/MutexTraits.h index 9de13e042a..b6ec878e98 100644 --- a/modules/beast_core/thread/MutexTraits.h +++ b/modules/beast_core/thread/MutexTraits.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_THREAD_MUTEXTRAITS_H_INCLUDED #define BEAST_CORE_THREAD_MUTEXTRAITS_H_INCLUDED +namespace beast +{ + /** Adapt a Mutex type to meet the boost::Mutex concept requirements. The default implementation assumes adherance to the boost::Mutex concepts, with one important exception. We make the member functions const, for @@ -72,4 +75,6 @@ struct MutexTraits } }; +} // namespace beast + #endif diff --git a/modules/beast_core/thread/Workers.cpp b/modules/beast_core/thread/Workers.cpp index f6ef90ae39..71cf22f417 100644 --- a/modules/beast_core/thread/Workers.cpp +++ b/modules/beast_core/thread/Workers.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + Workers::Workers (Callback& callback, String const& threadNames, int numberOfThreads) : m_callback (callback) , m_threadNames (threadNames) @@ -299,3 +302,5 @@ public: }; static WorkersTests workersTests; + +} // namespace beast diff --git a/modules/beast_core/thread/Workers.h b/modules/beast_core/thread/Workers.h index ff2a31fba8..c09e94d0fb 100644 --- a/modules/beast_core/thread/Workers.h +++ b/modules/beast_core/thread/Workers.h @@ -20,6 +20,9 @@ #ifndef BEAST_WORKERS_H_INCLUDED #define BEAST_WORKERS_H_INCLUDED +namespace beast +{ + /** A group of threads that process tasks. */ class Workers @@ -143,4 +146,6 @@ private: LockFreeStack m_paused; // holds just paused workers }; +} // namespace beast + #endif diff --git a/modules/beast_core/thread/detail/ScopedLock.h b/modules/beast_core/thread/detail/ScopedLock.h index e7665f6ddf..4d3dbc0b67 100644 --- a/modules/beast_core/thread/detail/ScopedLock.h +++ b/modules/beast_core/thread/detail/ScopedLock.h @@ -22,6 +22,9 @@ #include "../MutexTraits.h" +namespace beast +{ + namespace detail { @@ -249,4 +252,6 @@ private: } // namespace detail +} // namespace beast + #endif diff --git a/modules/beast_core/thread/detail/TrackedMutex.h b/modules/beast_core/thread/detail/TrackedMutex.h index cb835c20b9..536a3ff229 100644 --- a/modules/beast_core/thread/detail/TrackedMutex.h +++ b/modules/beast_core/thread/detail/TrackedMutex.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_THREAD_DETAIL_TRACKEDMUTEX_H_INCLUDED #define BEAST_CORE_THREAD_DETAIL_TRACKEDMUTEX_H_INCLUDED +namespace beast +{ + class TrackedMutex; namespace detail @@ -93,4 +96,6 @@ struct TrackedMutexBasics } // namespace detail +} // namespace beast + #endif diff --git a/modules/beast_core/thread/impl/TrackedMutex.cpp b/modules/beast_core/thread/impl/TrackedMutex.cpp index 0978d402a7..502476556f 100644 --- a/modules/beast_core/thread/impl/TrackedMutex.cpp +++ b/modules/beast_core/thread/impl/TrackedMutex.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + namespace detail { @@ -559,3 +562,4 @@ static TrackedMutexUnitTests trackedMutexUnitTests; } // namespace detail +} // namespace beast diff --git a/modules/beast_core/thread/impl/TrackedMutex.h b/modules/beast_core/thread/impl/TrackedMutex.h index 30e797f28d..0946d40c75 100644 --- a/modules/beast_core/thread/impl/TrackedMutex.h +++ b/modules/beast_core/thread/impl/TrackedMutex.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_THREAD_IMPL_TRACKEDMUTEX_H_INCLUDED #define BEAST_CORE_THREAD_IMPL_TRACKEDMUTEX_H_INCLUDED +namespace beast +{ + /** Common types and member functions for a TrackedMutex */ class TrackedMutex : public detail::TrackedMutexBasics::ThreadLockList::Node @@ -165,4 +168,6 @@ private: SharedState mutable m_state; }; +} // namespace beast + #endif diff --git a/modules/beast_core/thread/impl/TrackedMutexType.h b/modules/beast_core/thread/impl/TrackedMutexType.h index 654ffe52b0..5e0528dd25 100644 --- a/modules/beast_core/thread/impl/TrackedMutexType.h +++ b/modules/beast_core/thread/impl/TrackedMutexType.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_THREAD_TRACKEDMUTEXTYPE_H_INCLUDED #define BEAST_CORE_THREAD_TRACKEDMUTEXTYPE_H_INCLUDED +namespace beast +{ + /** A template that gives a Mutex diagnostic tracking capabilities. */ template class TrackedMutexType @@ -92,4 +95,6 @@ private: Mutex const m_mutex; }; +} // namespace beast + #endif diff --git a/modules/beast_core/thread/impl/UntrackedMutexType.h b/modules/beast_core/thread/impl/UntrackedMutexType.h index 3768bb66a5..22c53d27d5 100644 --- a/modules/beast_core/thread/impl/UntrackedMutexType.h +++ b/modules/beast_core/thread/impl/UntrackedMutexType.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_THREAD_IMPL_UNTRACKEDMUTEX_H_INCLUDED #define BEAST_CORE_THREAD_IMPL_UNTRACKEDMUTEX_H_INCLUDED +namespace beast +{ + /** A drop-in replacement for TrackedMutex without the tracking. */ template @@ -79,4 +82,6 @@ private: Mutex mutable m_mutex; }; +} // namespace beast + #endif diff --git a/modules/beast_core/threads/ChildProcess.cpp b/modules/beast_core/threads/ChildProcess.cpp index 3aafba1b66..a7a68fe709 100644 --- a/modules/beast_core/threads/ChildProcess.cpp +++ b/modules/beast_core/threads/ChildProcess.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + ChildProcess::ChildProcess() {} ChildProcess::~ChildProcess() {} @@ -96,3 +99,5 @@ public: }; static ChildProcessTests childProcessTests; + +} // namespace beast diff --git a/modules/beast_core/threads/ChildProcess.h b/modules/beast_core/threads/ChildProcess.h index 142f34d63c..1561274606 100644 --- a/modules/beast_core/threads/ChildProcess.h +++ b/modules/beast_core/threads/ChildProcess.h @@ -24,6 +24,8 @@ #ifndef BEAST_CHILDPROCESS_H_INCLUDED #define BEAST_CHILDPROCESS_H_INCLUDED +namespace beast +{ //============================================================================== /** @@ -94,5 +96,6 @@ private: ScopedPointer activeProcess; }; +} // namespace beast #endif // BEAST_CHILDPROCESS_H_INCLUDED diff --git a/modules/beast_core/threads/CriticalSection.h b/modules/beast_core/threads/CriticalSection.h index a130cb318b..b51003e0bc 100644 --- a/modules/beast_core/threads/CriticalSection.h +++ b/modules/beast_core/threads/CriticalSection.h @@ -24,6 +24,9 @@ #ifndef BEAST_CRITICALSECTION_H_INCLUDED #define BEAST_CRITICALSECTION_H_INCLUDED +namespace beast +{ + //============================================================================== /** A re-entrant mutex. @@ -252,5 +255,6 @@ typedef CriticalSection::ScopedUnlockType ScopedUnlock; */ typedef CriticalSection::ScopedTryLockType ScopedTryLock; +} // namespace beast #endif // BEAST_CRITICALSECTION_H_INCLUDED diff --git a/modules/beast_core/threads/DynamicLibrary.h b/modules/beast_core/threads/DynamicLibrary.h index 679195924e..e1bec186ae 100644 --- a/modules/beast_core/threads/DynamicLibrary.h +++ b/modules/beast_core/threads/DynamicLibrary.h @@ -24,6 +24,9 @@ #ifndef BEAST_DYNAMICLIBRARY_H_INCLUDED #define BEAST_DYNAMICLIBRARY_H_INCLUDED +namespace beast +{ + /** Handles the opening and closing of DLLs. @@ -74,5 +77,6 @@ private: void* handle; }; +} // namespace beast #endif // BEAST_DYNAMICLIBRARY_H_INCLUDED diff --git a/modules/beast_core/threads/HighResolutionTimer.cpp b/modules/beast_core/threads/HighResolutionTimer.cpp index 68cd34988d..6298bb8831 100644 --- a/modules/beast_core/threads/HighResolutionTimer.cpp +++ b/modules/beast_core/threads/HighResolutionTimer.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + HighResolutionTimer::HighResolutionTimer() { pimpl = new Pimpl (*this); } HighResolutionTimer::~HighResolutionTimer() { stopTimer(); } @@ -29,3 +32,5 @@ void HighResolutionTimer::stopTimer() { pimpl->stop(); } bool HighResolutionTimer::isTimerRunning() const noexcept { return pimpl->periodMs != 0; } int HighResolutionTimer::getTimerInterval() const noexcept { return pimpl->periodMs; } + +} // namespace beast diff --git a/modules/beast_core/threads/HighResolutionTimer.h b/modules/beast_core/threads/HighResolutionTimer.h index 9cc391611c..f27ed16270 100644 --- a/modules/beast_core/threads/HighResolutionTimer.h +++ b/modules/beast_core/threads/HighResolutionTimer.h @@ -24,6 +24,9 @@ #ifndef BEAST_HIGHRESOLUTIONTIMER_H_INCLUDED #define BEAST_HIGHRESOLUTIONTIMER_H_INCLUDED +namespace beast +{ + /** A high-resolution periodic timer. @@ -98,5 +101,6 @@ private: ScopedPointer pimpl; }; +} // namespace beast #endif // BEAST_HIGHRESOLUTIONTIMER_H_INCLUDED diff --git a/modules/beast_core/threads/InterProcessLock.h b/modules/beast_core/threads/InterProcessLock.h index 412550ce05..a06c5d5685 100644 --- a/modules/beast_core/threads/InterProcessLock.h +++ b/modules/beast_core/threads/InterProcessLock.h @@ -24,6 +24,9 @@ #ifndef BEAST_INTERPROCESSLOCK_H_INCLUDED #define BEAST_INTERPROCESSLOCK_H_INCLUDED +namespace beast +{ + //============================================================================== /** Acts as a critical section which processes can use to block each other. @@ -114,5 +117,6 @@ private: String name; }; +} // namespace beast #endif // BEAST_INTERPROCESSLOCK_H_INCLUDED diff --git a/modules/beast_core/threads/Process.h b/modules/beast_core/threads/Process.h index d49bd27d7a..ef6e242f8c 100644 --- a/modules/beast_core/threads/Process.h +++ b/modules/beast_core/threads/Process.h @@ -24,6 +24,9 @@ #ifndef BEAST_PROCESS_H_INCLUDED #define BEAST_PROCESS_H_INCLUDED +namespace beast +{ + //============================================================================== /** Represents the current executable's process. @@ -137,5 +140,6 @@ private: Process(); }; +} // namespace beast #endif // BEAST_PROCESS_H_INCLUDED diff --git a/modules/beast_core/threads/ScopedLock.h b/modules/beast_core/threads/ScopedLock.h index e30d68efe5..c0b7ec02c5 100644 --- a/modules/beast_core/threads/ScopedLock.h +++ b/modules/beast_core/threads/ScopedLock.h @@ -24,6 +24,9 @@ #ifndef BEAST_SCOPEDLOCK_H_INCLUDED #define BEAST_SCOPEDLOCK_H_INCLUDED +namespace beast +{ + //============================================================================== /** Automatically locks and unlocks a mutex object. @@ -240,5 +243,7 @@ private: const bool lockWasSuccessful; }; +} // namespace beast + #endif diff --git a/modules/beast_core/threads/SpinDelay.cpp b/modules/beast_core/threads/SpinDelay.cpp index 959dc42f60..51ae11794f 100644 --- a/modules/beast_core/threads/SpinDelay.cpp +++ b/modules/beast_core/threads/SpinDelay.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + SpinDelay::SpinDelay () : m_count (0) { @@ -27,3 +30,5 @@ void SpinDelay::pause () if (++m_count > 20) Thread::yield (); } + +} // namespace beast diff --git a/modules/beast_core/threads/SpinDelay.h b/modules/beast_core/threads/SpinDelay.h index 4965445ed0..8930c9f04f 100644 --- a/modules/beast_core/threads/SpinDelay.h +++ b/modules/beast_core/threads/SpinDelay.h @@ -20,6 +20,9 @@ #ifndef BEAST_SPINDELAY_H_INCLUDED #define BEAST_SPINDELAY_H_INCLUDED +namespace beast +{ + /** A simple delay used to synchronize threads. */ class BEAST_API SpinDelay @@ -33,4 +36,6 @@ private: int m_count; }; +} // namespace beast + #endif diff --git a/modules/beast_core/time/AtExitHook.cpp b/modules/beast_core/time/AtExitHook.cpp index e983b7f28d..b6d5a3fa2d 100644 --- a/modules/beast_core/time/AtExitHook.cpp +++ b/modules/beast_core/time/AtExitHook.cpp @@ -17,6 +17,9 @@ */ //============================================================================== +namespace beast +{ + // Manages the list of hooks, and calls // whoever is in the list at exit time. // @@ -133,3 +136,5 @@ AtExitHook::~AtExitHook () { Manager::get().erase (m_item); } + +} // namespace beast diff --git a/modules/beast_core/time/AtExitHook.h b/modules/beast_core/time/AtExitHook.h index 26801d23d9..703e1733c0 100644 --- a/modules/beast_core/time/AtExitHook.h +++ b/modules/beast_core/time/AtExitHook.h @@ -20,6 +20,9 @@ #ifndef BEAST_CORE_ATEXITHOOK_H_INCLUDED #define BEAST_CORE_ATEXITHOOK_H_INCLUDED +namespace beast +{ + /** Hook for performing activity on program exit. These hooks execute when objects with static storage duration are @@ -85,4 +88,6 @@ private: }; /** @} */ +} // namespace beast + #endif diff --git a/modules/beast_core/time/PerformanceCounter.cpp b/modules/beast_core/time/PerformanceCounter.cpp index 6231e11b1e..3781df0c71 100644 --- a/modules/beast_core/time/PerformanceCounter.cpp +++ b/modules/beast_core/time/PerformanceCounter.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + PerformanceCounter::PerformanceCounter (const String& name_, const int runsPerPrintout, const File& loggingFile) @@ -88,3 +91,5 @@ void PerformanceCounter::printStatistics() totalTime = 0; } } + +} // namespace beast diff --git a/modules/beast_core/time/PerformanceCounter.h b/modules/beast_core/time/PerformanceCounter.h index 504dd2f126..f726c6bf10 100644 --- a/modules/beast_core/time/PerformanceCounter.h +++ b/modules/beast_core/time/PerformanceCounter.h @@ -24,6 +24,9 @@ #ifndef BEAST_PERFORMANCECOUNTER_H_INCLUDED #define BEAST_PERFORMANCECOUNTER_H_INCLUDED +namespace beast +{ + //============================================================================== /** A timer for measuring performance of code and dumping the results to a file. @@ -98,4 +101,6 @@ private: File outputFile; }; +} // namespace beast + #endif // BEAST_PERFORMANCECOUNTER_H_INCLUDED diff --git a/modules/beast_core/time/Time.cpp b/modules/beast_core/time/Time.cpp index c84c98eaf6..c6437fbafe 100644 --- a/modules/beast_core/time/Time.cpp +++ b/modules/beast_core/time/Time.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + namespace TimeHelpers { static struct tm millisToLocal (const int64 millis) noexcept @@ -439,3 +442,5 @@ bool operator< (Time time1, Time time2) { return time1.toMilliseconds() < bool operator> (Time time1, Time time2) { return time1.toMilliseconds() > time2.toMilliseconds(); } bool operator<= (Time time1, Time time2) { return time1.toMilliseconds() <= time2.toMilliseconds(); } bool operator>= (Time time1, Time time2) { return time1.toMilliseconds() >= time2.toMilliseconds(); } + +} // namespace beast diff --git a/modules/beast_core/time/Time.h b/modules/beast_core/time/Time.h index 9628333f8f..5c40698e7c 100644 --- a/modules/beast_core/time/Time.h +++ b/modules/beast_core/time/Time.h @@ -24,6 +24,9 @@ #ifndef BEAST_TIME_H_INCLUDED #define BEAST_TIME_H_INCLUDED +namespace beast +{ + //============================================================================== /** Holds an absolute date and time. @@ -409,5 +412,6 @@ BEAST_API bool operator> (Time time1, Time time2); /** Compares two Time objects. */ BEAST_API bool operator>= (Time time1, Time time2); +} // namespace beast #endif // BEAST_TIME_H_INCLUDED diff --git a/modules/beast_core/xml/XmlDocument.cpp b/modules/beast_core/xml/XmlDocument.cpp index 9e2db7496a..f6d79440c9 100644 --- a/modules/beast_core/xml/XmlDocument.cpp +++ b/modules/beast_core/xml/XmlDocument.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + XmlDocument::XmlDocument (const String& documentText) : originalText (documentText), input (nullptr), @@ -868,4 +871,6 @@ String XmlDocument::getParameterEntity (const String& entity) } return entity; -} \ No newline at end of file +} + +} // namespace beast diff --git a/modules/beast_core/xml/XmlDocument.h b/modules/beast_core/xml/XmlDocument.h index 5e9a85692b..6317b45e0d 100644 --- a/modules/beast_core/xml/XmlDocument.h +++ b/modules/beast_core/xml/XmlDocument.h @@ -24,6 +24,9 @@ #ifndef BEAST_XMLDOCUMENT_H_INCLUDED #define BEAST_XMLDOCUMENT_H_INCLUDED +namespace beast +{ + //============================================================================== /** Parses a text-based XML document and creates an XmlElement object from it. @@ -169,5 +172,6 @@ private: ScopedPointer inputSource; }; -#endif +} // namespace beast +#endif diff --git a/modules/beast_core/xml/XmlElement.cpp b/modules/beast_core/xml/XmlElement.cpp index cfa5de5a28..5aab136679 100644 --- a/modules/beast_core/xml/XmlElement.cpp +++ b/modules/beast_core/xml/XmlElement.cpp @@ -21,6 +21,9 @@ */ //============================================================================== +namespace beast +{ + XmlElement::XmlAttributeNode::XmlAttributeNode (const XmlAttributeNode& other) noexcept : name (other.name), value (other.value) @@ -819,3 +822,5 @@ void XmlElement::deleteAllTextElements() noexcept child = next; } } + +} // namespace beast diff --git a/modules/beast_core/xml/XmlElement.h b/modules/beast_core/xml/XmlElement.h index 4875d69832..34de5227a1 100644 --- a/modules/beast_core/xml/XmlElement.h +++ b/modules/beast_core/xml/XmlElement.h @@ -24,6 +24,9 @@ #ifndef BEAST_XMLELEMENT_H_INCLUDED #define BEAST_XMLELEMENT_H_INCLUDED +namespace beast +{ + //============================================================================== /** A handy macro to make it easy to iterate all the child elements in an XmlElement. @@ -722,5 +725,6 @@ private: void reorderChildElements (XmlElement**, int) noexcept; }; +} // namespace beast #endif // BEAST_XMLELEMENT_H_INCLUDED diff --git a/modules/beast_core/zip/GZIPCompressorOutputStream.cpp b/modules/beast_core/zip/GZIPCompressorOutputStream.cpp index 683133d79b..c3583ced4b 100644 --- a/modules/beast_core/zip/GZIPCompressorOutputStream.cpp +++ b/modules/beast_core/zip/GZIPCompressorOutputStream.cpp @@ -26,6 +26,9 @@ ============================================================================== */ +namespace beast +{ + class GZIPCompressorOutputStream::GZIPCompressorHelper : public Uncopyable { public: @@ -206,3 +209,5 @@ public: }; static GZIPTests gzipTests; + +} // namespace beast diff --git a/modules/beast_core/zip/GZIPCompressorOutputStream.h b/modules/beast_core/zip/GZIPCompressorOutputStream.h index 88a0e25cef..c14c759c23 100644 --- a/modules/beast_core/zip/GZIPCompressorOutputStream.h +++ b/modules/beast_core/zip/GZIPCompressorOutputStream.h @@ -29,6 +29,9 @@ #ifndef BEAST_GZIPCOMPRESSOROUTPUTSTREAM_H_INCLUDED #define BEAST_GZIPCOMPRESSOROUTPUTSTREAM_H_INCLUDED +namespace beast +{ + //============================================================================== /** A stream which uses zlib to compress the data written into it. @@ -97,4 +100,6 @@ private: ScopedPointer helper; }; +} // namespace beast + #endif // BEAST_GZIPCOMPRESSOROUTPUTSTREAM_H_INCLUDED diff --git a/modules/beast_core/zip/GZIPDecompressorInputStream.cpp b/modules/beast_core/zip/GZIPDecompressorInputStream.cpp index b044649714..b10eb42a74 100644 --- a/modules/beast_core/zip/GZIPDecompressorInputStream.cpp +++ b/modules/beast_core/zip/GZIPDecompressorInputStream.cpp @@ -26,6 +26,9 @@ ============================================================================== */ +namespace beast +{ + #if BEAST_MSVC #pragma warning (push) #pragma warning (disable: 4309 4305 4365) @@ -290,3 +293,5 @@ unsigned long beast_crc32 (unsigned long crc, const unsigned char* buf, unsigned { return zlibNamespace::crc32 (crc, buf, len); } + +} // namespace beast diff --git a/modules/beast_core/zip/GZIPDecompressorInputStream.h b/modules/beast_core/zip/GZIPDecompressorInputStream.h index 14a525f394..904c0de270 100644 --- a/modules/beast_core/zip/GZIPDecompressorInputStream.h +++ b/modules/beast_core/zip/GZIPDecompressorInputStream.h @@ -29,6 +29,9 @@ #ifndef BEAST_GZIPDECOMPRESSORINPUTSTREAM_H_INCLUDED #define BEAST_GZIPDECOMPRESSORINPUTSTREAM_H_INCLUDED +namespace beast +{ + //============================================================================== /** This stream will decompress a source-stream using zlib. @@ -94,4 +97,6 @@ private: ScopedPointer helper; }; +} // namespace beast + #endif // BEAST_GZIPDECOMPRESSORINPUTSTREAM_H_INCLUDED diff --git a/modules/beast_core/zip/ZipFile.cpp b/modules/beast_core/zip/ZipFile.cpp index bc3c6f0b4f..3bc341ff98 100644 --- a/modules/beast_core/zip/ZipFile.cpp +++ b/modules/beast_core/zip/ZipFile.cpp @@ -26,6 +26,9 @@ ============================================================================== */ +namespace beast +{ + class ZipFile::ZipEntryHolder { public: @@ -593,3 +596,5 @@ bool ZipFile::Builder::writeToStream (OutputStream& target, double* const progre return true; } + +} // namespace beast diff --git a/modules/beast_core/zip/ZipFile.h b/modules/beast_core/zip/ZipFile.h index 7fd08b10be..078beab4c0 100644 --- a/modules/beast_core/zip/ZipFile.h +++ b/modules/beast_core/zip/ZipFile.h @@ -29,6 +29,9 @@ #ifndef BEAST_ZIPFILE_H_INCLUDED #define BEAST_ZIPFILE_H_INCLUDED +namespace beast +{ + //============================================================================== /** Decodes a ZIP file from a stream. @@ -236,4 +239,6 @@ private: void init(); }; +} // namespace beast + #endif // BEAST_ZIPFILE_H_INCLUDED